From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58560) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1am13J-0006BF-0c for qemu-devel@nongnu.org; Fri, 01 Apr 2016 11:32:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1am13D-0007jm-48 for qemu-devel@nongnu.org; Fri, 01 Apr 2016 11:32:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34461) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1am13C-0007jb-Tk for qemu-devel@nongnu.org; Fri, 01 Apr 2016 11:31:55 -0400 References: <56FD7B7E.4060004@redhat.com> <64B326DA-CDF4-4537-B38A-46E7B57C319C@alex.org.uk> <56FD8069.7020101@redhat.com> <56FD89D0.5050408@redhat.com> <20160401082715.GB25514@grep.be> <56FE82B3.4010205@redhat.com> <33E7C614-E8C4-48FF-84BE-7F2418C65D22@alex.org.uk> <56FE8EF8.3080603@redhat.com> <97BC88F7-95E9-4ACB-BCA2-43A43ED5519E@alex.org.uk> From: Eric Blake Message-ID: <56FE9469.8000900@redhat.com> Date: Fri, 1 Apr 2016 09:31:53 -0600 MIME-Version: 1.0 In-Reply-To: <97BC88F7-95E9-4ACB-BCA2-43A43ED5519E@alex.org.uk> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="iWEMDBwWPDPB5raX5WKeSpMijbs23cr2q" Subject: Re: [Qemu-devel] [Nbd] Is NBD_CMD_FLAG_FUA valid during NBD_CMD_FLUSH? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Bligh Cc: "nbd-general@lists.sourceforge.net" , Wouter Verhelst , "qemu-devel@nongnu.org" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --iWEMDBwWPDPB5raX5WKeSpMijbs23cr2q Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 04/01/2016 09:13 AM, Alex Bligh wrote: >=20 > On 1 Apr 2016, at 16:12, Alex Bligh wrote: >=20 >> as qemu doesn't use FUA on write and the kernel doesn't use FUA >=20 > "as qemu doesn't use FUA other than on write" - sorry qemu's block/nbd-client.c currently sends NBD_CMD_FLAG_FUA on NBD_CMD_FLUSH (unconditionally, if NBD_FLAG_SEND_FUA was advertised), and on NBD_CMD_WRITE (conditionally: if NBD_FLAG_SEND_FUA was advertised AND the upper layer requested FUA). I don't see it being sent on reads, so on that front, you appear to be correct that no common clients are expecting any particular behavior on reads. qemu's nbd/server.c silently ignores NBD_CMD_FLAG_FUA on all commands except NBD_CMD_READ (conditionally calls blk_co_flush()), NBD_CMD_WRITE (conditionally calls blk_co_flush()). Ignoring the flag on NBD_CMD_FLUSH seems to make sense, since that code unconditionally calls blk_co_flush(), which is all the more the flag was enabling on read/write. And if you are correct that no real clients are sending FUA on READ, then deleting (or changing) the server support for FUA on read should have no negative impact. qemu doesn't yet implement WRITE_ZEROES. When qemu client is talking to a qemu server, there is no incompatibility between the two - all client commands that set FUA are sanely handled by the recipient server code. But the same is not true if you pair a current qemu client with current nbd.git server, as the qemu will unconditionally set FUA on flush, and the server now rejects it as an invalid flag (thus making it impossible for qemu to flush). So we probably ought to fix qemu client to quit unconditionally sending FUA (no change when qemu client talks to qemu server); and at the same time out to fix NBD server to silently ignore FUA on flush (fix the breakage between the pairing). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --iWEMDBwWPDPB5raX5WKeSpMijbs23cr2q 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/ iQEcBAEBCAAGBQJW/pRpAAoJEKeha0olJ0Nqy+0IAKyIRmfxIctjC95y1OY0WhLf xwKaQToIZ0yTa9equ3CmPIa5FBfwEk8bK5dnPYFCRC74lkBcVc3zkTaMHk94yxbW GFUgAKVOnepIydyCP6EFHs0s/jwE6b8s3x1kez83eV9I2AkZuqN1Jt2HPvnm4IyX v5Bs3c+36yUNA1MNf+hA/OYzh8eD7BBz0fw10An3uMiAxBdhR9Jm+AS1dxIZJ1nR QgZ+DYCuROq2J4xW5Y3EXhZ5yD9bltftg6ce87yngN3j95Y6jQW7ACMZmXZle1/o QkAlYdvVuP7mFeYvwGYNfkFxT4Yl9fHmXqQevJ/aza+6Gfa2VGLm8G1xeJcarqQ= =XXsV -----END PGP SIGNATURE----- --iWEMDBwWPDPB5raX5WKeSpMijbs23cr2q--