Re: [Nbd] [PATCH 1/2] NBD proto: add WRITE_ZEROES extension
- To: Pavel Borzenkov <pborzenkov@...2319...>
- Cc: nbd-general@lists.sourceforge.net, Kevin Wolf <kwolf@...696...>, qemu-devel@...530..., Stefan Hajnoczi <stefanha@...696...>, Paolo Bonzini <pbonzini@...696...>, "Denis V. Lunev" <den@...2317...>
- Subject: Re: [Nbd] [PATCH 1/2] NBD proto: add WRITE_ZEROES extension
- From: Wouter Verhelst <w@...112...>
- Date: Thu, 24 Mar 2016 09:26:41 +0100
- Message-id: <20160324082641.GF1590@...3...>
- In-reply-to: <20160324075706.GA24831@...2346...>
- References: <1458742562-30624-1-git-send-email-den@...2317...> <1458742562-30624-2-git-send-email-den@...2317...> <20160323172116.GA2467@...3...> <20160324075706.GA24831@...2346...>
On Thu, Mar 24, 2016 at 10:57:06AM +0300, Pavel Borzenkov wrote:
> On Wed, Mar 23, 2016 at 06:21:16PM +0100, Wouter Verhelst wrote:
> > So, the semantics of your proposed WRITE_ZEROES are exactly the same as
> > the WRITE command, except that no payload is sent?
> >
> > In that case, I think it's slightly more sensible if we don't add a new
> > command, but instead just have an NBD_CMD_FLAG_ZEROES added to the WRITE
> > command instead. After all, they're going to be (mostly) the same
> > anyway.
> >
> > Did you propose a separate command for a specific reason that I'm
> > missing (or forgetting), or is that just an oversight?
>
> No, there is no specific reason. Looks like NBD_CMD_FLAG_ZEROES fits the
> spec and implementations nicely. So I'll rewrite the extension and add
> the flag instead of the whole command.
Actually, having given this some more thought...
There is at least one server-side implementation of nbd (mine) which
silently ignores flags it doesn't know about. This isn't a problem for
non-critical flags, but it could be a problem for a flag like this. Of
course, a client shouldn't send a flag to a server which that server
hasn't heard of, but mistakes do happen.
Do we want to keep that in mind? If so, we might want to keep it as a
separate command after all.
OTOH, it could be said that silently ignoring unknown messages is a bug.
I should probably just fix my implementation instead.
--
< ron> I mean, the main *practical* problem with C++, is there's like a dozen
people in the world who think they really understand all of its rules,
and pretty much all of them are just lying to themselves too.
-- #debian-devel, OFTC, 2016-02-12
Reply to: