From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUBcw-0005SF-03 for qemu-devel@nongnu.org; Mon, 01 Aug 2016 07:43:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUBcu-0005ar-TQ for qemu-devel@nongnu.org; Mon, 01 Aug 2016 07:43:21 -0400 References: <1469129688-22848-1-git-send-email-eblake@redhat.com> <1469129688-22848-3-git-send-email-eblake@redhat.com> From: Eric Blake Message-ID: <579F35CF.1050604@redhat.com> Date: Mon, 1 Aug 2016 05:43:11 -0600 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="L1utkpUR3W9tCtrFpWHxRio3rBknF9RrD" 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: Paolo Bonzini , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, pl@kamp.de, qemu-stable@nongnu.org, Kevin Wolf , Max Reitz This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --L1utkpUR3W9tCtrFpWHxRio3rBknF9RrD From: Eric Blake To: Paolo Bonzini , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, pl@kamp.de, qemu-stable@nongnu.org, Kevin Wolf , Max Reitz Message-ID: <579F35CF.1050604@redhat.com> Subject: Re: [PATCH 2/4] nbd: Limit nbdflags to 16 bits References: <1469129688-22848-1-git-send-email-eblake@redhat.com> <1469129688-22848-3-git-send-email-eblake@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 08/01/2016 03:17 AM, Paolo Bonzini wrote: >=20 >=20 > 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. >=20 > Should squash this in too: >=20 > 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(NBDClientNewD= ata *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); 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 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --L1utkpUR3W9tCtrFpWHxRio3rBknF9RrD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXnzXPAAoJEKeha0olJ0NquB4IAKOT0rAmG53WcV/lkhPaOvnX qZGv34Q75DBcnkL/V/baJ3jEJYP3z3dhHKMjkfO50xEZvcmvTX7EH67PRml0vqy+ qhu1zNw6LheUswkK5Y6CYyaK5qDkaSWz1vth+30G83HGgb0UyO2ofb+K/fzcGiId W1cU0+PkDcUv7ZcPmAJy+iBoY17Ol6GssjeMZnEOr08WQkZfhd0zwuFnpB3NL3Ni uj9+2PmHxkS5oqwbvXa2pWs/r3hf/eY8rpRI9iqMqLRuYq3C68TuFVTAmFGTiQJm hBZr5AnCeL346iWpuTfa4zM8ZAFY+hK6AiORmJZy+4I62DR6bYTN0nSpszc32KI= =l1Gh -----END PGP SIGNATURE----- --L1utkpUR3W9tCtrFpWHxRio3rBknF9RrD--