[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/3] NBD proto: forbid TRIM command without nego
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 1/3] NBD proto: forbid TRIM command without negotiation |
Date: |
Mon, 28 Mar 2016 07:00:17 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 |
On 03/28/2016 04:43 AM, Denis V. Lunev wrote:
> From: Pavel Borzenkov <address@hidden>
>
> There is a loophole in the protocol that allows a client to send TRIM
> request even if support for it wasn't negotiated with the server. State
> explicitly that the client MUST NOT send such command without prior
> successful negotiation.
>
> Signed-off-by: Pavel Borzenkov <address@hidden>
> Reviewed-by: Roman Kagan <address@hidden>
> Signed-off-by: Denis V. Lunev <address@hidden>
> CC: Wouter Verhelst <address@hidden>
> CC: Eric Blake <address@hidden>
> CC: Alex Bligh <address@hidden>
> ---
> doc/proto.md | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/doc/proto.md b/doc/proto.md
> index 6d1cb34..d54ed19 100644
> --- a/doc/proto.md
> +++ 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)?
But as this is a strict improvement,
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature