diff options
author | Eric Blake <eblake@redhat.com> | 2019-03-30 11:53:49 -0500 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2019-04-01 08:58:04 -0500 |
commit | 75d34eb98ca0bb2f49d607fcaefd9c482e56b15d (patch) | |
tree | 647d88581930fed3c16baf82cd4d9c816ea59024 /block/trace-events | |
parent | b0245d6478ea5906e3d7a542244d5c015fd47bc7 (diff) | |
download | qemu-75d34eb98ca0bb2f49d607fcaefd9c482e56b15d.zip qemu-75d34eb98ca0bb2f49d607fcaefd9c482e56b15d.tar.gz qemu-75d34eb98ca0bb2f49d607fcaefd9c482e56b15d.tar.bz2 |
nbd/client: Trace server noncompliance on structured reads
Just as we recently added a trace for a server sending block status
that doesn't match the server's advertised minimum block alignment,
let's do the same for read chunks. But since qemu 3.1 is such a
server (because it advertised 512-byte alignment, but when serving a
file that ends in data but is not sector-aligned, NBD_CMD_READ would
detect a mid-sector change between data and hole at EOF and the
resulting read chunks are unaligned), we don't want to change our
behavior of otherwise tolerating unaligned reads.
Note that even though we fixed the server for 4.0 to advertise an
actual block alignment (which gets rid of the unaligned reads at EOF
for posix files), we can still trigger it via other means:
$ qemu-nbd --image-opts driver=blkdebug,align=512,image.driver=file,image.filename=/path/to/non-aligned-file
Arguably, that is a bug in the blkdebug block status function, for
leaking a block status that is not aligned. It may also be possible to
observe issues with a backing layer with smaller alignment than the
active layer, although so far I have been unable to write a reliable
iotest for that scenario.
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20190330165349.32256-1-eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Diffstat (limited to 'block/trace-events')
-rw-r--r-- | block/trace-events | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/block/trace-events b/block/trace-events index debb25c..7335a42 100644 --- a/block/trace-events +++ b/block/trace-events @@ -158,6 +158,7 @@ iscsi_xcopy(void *src_lun, uint64_t src_off, void *dst_lun, uint64_t dst_off, ui # nbd-client.c nbd_parse_blockstatus_compliance(const char *err) "ignoring extra data from non-compliant server: %s" +nbd_structured_read_compliance(const char *type) "server sent non-compliant unaligned read %s chunk" nbd_read_reply_entry_fail(int ret, const char *err) "ret = %d, err: %s" nbd_co_request_fail(uint64_t from, uint32_t len, uint64_t handle, uint16_t flags, uint16_t type, const char *name, int ret, const char *err) "Request failed { .from = %" PRIu64", .len = %" PRIu32 ", .handle = %" PRIu64 ", .flags = 0x%" PRIx16 ", .type = %" PRIu16 " (%s) } ret = %d, err: %s" |