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

Re: [PATCH 1/2] doc: Explicit mention that 0-length transactions are unspecified



On 11/06/2017 10:52 AM, Eric Blake wrote:
> We don't want to forbid 0-length transactions between a client
> and server that have some special semantics for it, but we also
> don't want to define any particular semantics.  Best is to just
> document that portable clients should not attempt it, and that
> servers should tolerate clients that do it anyway (whether by a
> successful no-op or by an error code, we don't care, as long as
> the connection to the client is not killed).
> 
> While in the area, mention that a trim request may only cause a
> trim action on a subset of the request.

I can split this into two patches on commit, if you think I crammed too
much into one patch; it's just that both changes touch the same
paragraph, so I took the lazy way out on the initial post.

> @@ -1293,9 +1299,14 @@ The following request types exist:
> 
>  * `NBD_CMD_TRIM` (4)
> 
> -    A hint to the server that the data defined by len and offset is no
> -    longer needed. A server MAY discard len bytes starting at offset, but
> -    is not required to.
> +    A hint to the server that the data defined by length and offset is
> +    no longer needed. A server MAY discard *length* bytes starting at
> +    offset, but is not required to; and MAY round *offset* up and
> +    *length* down to meet internal alignment constraints so that only
> +    a portion of the client's request is actually discarded. The
> +    client SHOULD NOT request a trim length of 0; the behavior of a
> +    server on such a request is unspecified although the server SHOULD
> +    NOT disconnect.
> 


-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: