qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Alex Bligh <alex@alex.org.uk>
Cc: "nbd-general@lists.sourceforge.net"
	<nbd-general@lists.sourceforge.net>, Wouter Verhelst <w@uter.be>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [Nbd] Is NBD_CMD_FLAG_FUA valid during NBD_CMD_FLUSH?
Date: Fri, 1 Apr 2016 09:08:40 -0600	[thread overview]
Message-ID: <56FE8EF8.3080603@redhat.com> (raw)
In-Reply-To: <33E7C614-E8C4-48FF-84BE-7F2418C65D22@alex.org.uk>

[-- Attachment #1: Type: text/plain, Size: 2384 bytes --]

On 04/01/2016 09:00 AM, Alex Bligh wrote:
>>
>> Or rather than a flag bit, what about this strawman:
>>
>> NBD_FLAG_SEND_FUA: If set, the server understands the NBD_CMD_FLAG_FUA
>> bit.  Except where more specific mandatory or optional behavior is
>> documented on a given request, the server MUST ignore NBD_CMD_FLAG_FUA
>> if it advertised NBD_FLAG_SEND_FUA.  Clients SHOULD NOT assume that the
>> flag will have an effect on anything other than NBD_CMD_WRITE, unless
> 
> and NBD_CMD_WRITE_ZEROES presumably
> 
>> the client has first checked NBD_OPT_QUERY_FUA.  If clear, the client
>> MUST NOT use NBD_CMD_FLAG_FUA.
>>
>>
>> NBD_OPT_QUERY_FUA
>>  Data: 16 bits, the request type to check
>>  Responses:
> ...
>> Thoughts?
> 
> A bit overengineered I think. I can't realistically see clients writing
> code that would negotiate all that.

Fair enough. I was just throwing it out there so that at least we
considered our tradeoffs.

> 
> Personally I think we should stick to:
> 
> * Don't send FUA unless NBD_FLAG_SEND_FUA is set
> 
> * FUA works on NBD_CMD_WRITE and NBD_CMD_WRITE_ZEROES
> 
> * On all the other commands:
> 
>   - If it does anything in the linux kernel, we should make
>     it do the same thing here. (We know it doesn't for Qemu
>     or rather Qemu doesn't rely on it)
> 
>   - If it does not do anything in the linux kernel, then we
>     should decide whether we want to: do
>     a) client SHOULD NOT send, server MUST ignore it (my preference)
>     or
>     b) client MUST NOT send, server MUST close connection.

closing the connection is not strictly necessary (except maybe for
NBD_CMD_READ without structured replies); for all other commands, the
server may reply with EINVAL error instead of closing the connection.

But yes, I'm favoring a) as well, for the simplicity factor.  There's
still the issue that if we document a behavior, a new client talking to
an older server can't reliably tell if the behavior will be guaranteed.

> I suppose I am going have to try another lkml message to get
> to the bottom of the first one. On the other hand if we
> take route (a) above, we can relatively easily add a
> 'meaning' later as people can't have been relying on it
> working.

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2016-04-01 15:08 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-31 19:33 [Qemu-devel] Is NBD_CMD_FLAG_FUA valid during NBD_CMD_FLUSH? Eric Blake
2016-03-31 19:41 ` [Qemu-devel] [Nbd] " Alex Bligh
2016-03-31 19:54   ` Eric Blake
2016-03-31 20:17     ` Alex Bligh
2016-03-31 20:34       ` Eric Blake
2016-04-01  7:49         ` Paolo Bonzini
2016-04-01  9:25           ` Alex Bligh
2016-04-01  8:27         ` Wouter Verhelst
2016-04-01  9:40           ` Alex Bligh
2016-04-01 14:16           ` Eric Blake
2016-04-01 15:00             ` Alex Bligh
2016-04-01 15:08               ` Eric Blake [this message]
2016-04-01 15:12                 ` Alex Bligh
2016-04-01 15:13                   ` Alex Bligh
2016-04-01 15:31                     ` Eric Blake
2016-04-01 15:46                       ` Alex Bligh
2016-05-02 17:08         ` Eric Blake
2016-04-01  7:43       ` Paolo Bonzini
2016-04-01  9:19         ` Alex Bligh
2016-04-05  5:09         ` Kevin Wolf
2016-04-05 13:28           ` Paolo Bonzini
2016-04-06 13:14             ` Kevin Wolf
2016-04-06 13:28               ` Paolo Bonzini
2016-04-06 13:50                 ` Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56FE8EF8.3080603@redhat.com \
    --to=eblake@redhat.com \
    --cc=alex@alex.org.uk \
    --cc=nbd-general@lists.sourceforge.net \
    --cc=qemu-devel@nongnu.org \
    --cc=w@uter.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).