[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Nbd] [PATCH 1/3] NBD proto: forbid TRIM command withou
Re: [Qemu-devel] [Nbd] [PATCH 1/3] NBD proto: forbid TRIM command without negotiation
Tue, 29 Mar 2016 07:54:26 -0600
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1
On 03/29/2016 01:22 AM, Wouter Verhelst wrote:
>>> +++ b/doc/proto.md
>>> @@ -471,6 +471,9 @@ The following request types exist:
>>> about the contents of the export affected by this command, until
>>> overwriting it again with `NBD_CMD_WRITE`.
>>> + A client MUST NOT send a trim request unless `NBD_FLAG_SEND_TRIM`
>>> + was set in the export flags field.
>> Do we also want to mention that the server SHOULD fail with EINVAL if
>> the client sends it anyway, and similarly if NBD_CMD_FLUSH was sent
>> without the appropriate export flag (but that the client should not rely
>> on that particular failure)?
> I think the protocol should mention that the server MAY fail with
> EINVAL, rather than SHOULD. Rationale: the robusness principle -- if you
> didn't negotiate it, you may end up with a server who doesn't know about
> the feature; but if it just so happens that the server does know about it even
> though you didn't negotiate it, there is little harm in it following up on the
Good point; furthermore, a server is compliant if it accepts and ignores
NBD_CMD_TRIM (as that command is only a hint); which is different from
NBD_CMD_FLUSH (which must ensure a barrier).
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 2/3] NBD proto: document additional error conditions, (continued)