All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, pl@kamp.de, qemu-stable@nongnu.org,
	Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/4] nbd: Limit nbdflags to 16 bits
Date: Mon, 1 Aug 2016 05:43:11 -0600	[thread overview]
Message-ID: <579F35CF.1050604@redhat.com> (raw)
In-Reply-To: <d44c239d-777d-9288-62cf-2083f3b18cae@redhat.com>

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

On 08/01/2016 03:17 AM, Paolo Bonzini wrote:
> 
> 
> On 21/07/2016 21:34, Eric Blake wrote:
>> Furthermore, upstream NBD has never passed the global flags to
>> the kernel via ioctl(NBD_SET_FLAGS) (the ioctl was first
>> introduced in NBD 2.9.22; then a latent bug in NBD 3.1 actually
>> tried to OR the global flags with the transmission flags, with
>> the disaster that the addition of NBD_FLAG_NO_ZEROES in 3.9
>> caused all earlier NBD 3.x clients to treat every export as
>> read-only; NBD 3.10 and later intentionally clip things to 16
>> bits to pass only transmission flags).  Qemu should follow suit,
>> since the current two global flags (NBD_FLAG_FIXED_NEWSTYLE
>> and NBD_FLAG_NO_ZEROES) have no impact on the kernel's behavior
>> during transmission.
> 
> Should squash this in too:
> 
> diff --git a/nbd/server.c b/nbd/server.c
> index 80fbb4d..6fa2f9c 100644
> --- a/nbd/server.c
> +++ b/nbd/server.c
> @@ -575,7 +575,7 @@ static coroutine_fn int nbd_negotiate(NBDClientNewData *data)
>  
>      oldStyle = client->exp != NULL && !client->tlscreds;
>      if (oldStyle) {
> -        TRACE("advertising size %" PRIu64 " and flags %x",
> +        TRACE("advertising size %" PRIu64 " and flags %" PRIx16,
>                client->exp->size, client->exp->nbdflags | myflags);

No, we shouldn't. Last time I tried that, we tickled a clang bug where
%hx gripes when presented an 'int' argument, in spite of the int
argument being computed as 'short | short'. See commit 2cb34749, and
your discussion leading up to it:
https://lists.gnu.org/archive/html/qemu-devel/2016-06/msg04663.html

-- 
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-08-01 11:43 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-21 19:34 [Qemu-devel] [PATCH for-2.7 0/4] NBD and block alignment fixes Eric Blake
2016-07-21 19:34 ` [Qemu-devel] [PATCH 1/4] nbd: Fix bad flag detection on server Eric Blake
2016-07-21 19:34 ` [Qemu-devel] [PATCH 2/4] nbd: Limit nbdflags to 16 bits Eric Blake
2016-08-01  9:17   ` Paolo Bonzini
2016-08-01 11:43     ` Eric Blake [this message]
2016-08-01 11:50       ` Paolo Bonzini
2016-07-21 19:34 ` [Qemu-devel] [PATCH 3/4] osdep: Document differences in rounding macros Eric Blake
2016-08-01  9:19   ` Paolo Bonzini
2016-07-21 19:34 ` [Qemu-devel] [PATCH 4/4] block: Cater to iscsi with non-power-of-2 discard Eric Blake
2016-07-26 13:28   ` Stefan Hajnoczi
2016-07-27  7:25   ` Fam Zheng
2016-07-28  2:39     ` Eric Blake
2016-08-01  9:22       ` Paolo Bonzini
2016-10-25 12:03         ` Peter Lieven
2016-10-25 12:09           ` Paolo Bonzini
2016-10-25 12:12             ` Peter Lieven
2016-10-25 12:19               ` Paolo Bonzini
2016-10-25 12:42                 ` Peter Lieven
2016-10-25 13:59                   ` Eric Blake
2016-10-25 14:20                     ` Peter Lieven
2016-10-25 14:35                       ` Eric Blake
2016-10-25 14:36                         ` Paolo Bonzini
2016-10-25 16:12                           ` Eric Blake
2016-11-08 11:03                             ` Peter Lieven
2016-11-08 16:43                               ` Eric Blake
2016-11-11  4:02                               ` Eric Blake
2016-07-27  7:26 ` [Qemu-devel] [PATCH for-2.7 0/4] NBD and block alignment fixes Fam Zheng

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=579F35CF.1050604@redhat.com \
    --to=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=pl@kamp.de \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.