Received: from eggs.gnu.org ([2001:4830:134:3::10]:45084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUBjm-000106-Mt for qemu-devel@nongnu.org; Mon, 01 Aug 2016 07:50:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUBjl-0007Fp-L2 for qemu-devel@nongnu.org; Mon, 01 Aug 2016 07:50:26 -0400 References: <1469129688-22848-1-git-send-email-eblake@redhat.com> <1469129688-22848-3-git-send-email-eblake@redhat.com> <579F35CF.1050604@redhat.com> From: Paolo Bonzini Message-ID: Date: Mon, 1 Aug 2016 13:50:07 +0200 MIME-Version: 1.0 In-Reply-To: <579F35CF.1050604@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 2/4] nbd: Limit nbdflags to 16 bits List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, pl@kamp.de, qemu-stable@nongnu.org, Kevin Wolf , Max Reitz On 01/08/2016 13:43, Eric Blake wrote: > 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(NBDClientNew= Data *data) >> =20 >> oldStyle =3D client->exp !=3D 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); >=20 > 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 Uff, you're right. :( I remembered the discussion, but not the outcome. Paolo