[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Nbd] [PATCHv3] Document NBD_CMD_CLOSE



On 04/07/2016 01:01 PM, Alex Bligh wrote:
> This commit adds documentation for NBD_CMD_CLOSE which provides a
> safer way for the client to close connections, and indicates
> unambiguously to the server and client whether a close is safe.
> 
> Signed-off-by: Alex Bligh <alex@...872...>
> ---
>  doc/proto.md | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 72 insertions(+)
> 

> +
> +    The length and offset fields in an `NBD_CMD_CLOSE` request
> +    MUST both be zero.

s/length and offset/length, offset, and flags/

Remember, the current nbd.git reference server checks for invalid flags
PRIOR to acting on the command type, which would return EINVAL failure
without closing.  So put the burden on the client to never send any
possibly-bogus command flags (at which point if the client disobeys
protocol, they deserve whatever behavior the server gives them).

Yes, that means that NBD_CMD_FLAG_FUA + NBD_CMD_CLOSE is now locally
undefined (even though elsewhere, we said NBD_CMD_FLAG_FUA is globally
defined for all commands, even if that definition is by being ignored),
but I don't think that corner case matters enough to complicate the wording.

With that tweak,

Reviewed-by: Eric Blake <eblake@...696...>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: