Re: [Qemu-devel] [PATCH v2 for-2.11] nbd/server: Fix error reporting for bad requests

2017-11-17 Thread Eric Blake
On 11/16/2017 02:52 AM, Vladimir Sementsov-Ogievskiy wrote: >>   if (request->type == NBD_CMD_READ || request->type == >> NBD_CMD_WRITE) { >>   if (request->len > NBD_MAX_BUFFER_SIZE) { >>   error_setg(errp, "len (%" PRIu32" ) is larger than max >> len (%u)", > > related i

Re: [Qemu-devel] [PATCH v2 for-2.11] nbd/server: Fix error reporting for bad requests

2017-11-16 Thread Vladimir Sementsov-Ogievskiy
16.11.2017 00:35, Eric Blake wrote: The NBD spec says an attempt to NBD_CMD_TRIM on a read-only export should fail with EPERM, as a trim has the potential to change disk contents, but we were relying on the block layer to catch that for us, which might not always give the right error (and even if

[Qemu-devel] [PATCH v2 for-2.11] nbd/server: Fix error reporting for bad requests

2017-11-15 Thread Eric Blake
The NBD spec says an attempt to NBD_CMD_TRIM on a read-only export should fail with EPERM, as a trim has the potential to change disk contents, but we were relying on the block layer to catch that for us, which might not always give the right error (and even if it does, it does not let us pass back