From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53802) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axHRe-0000X6-K7 for qemu-devel@nongnu.org; Mon, 02 May 2016 13:15:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1axHRS-0002Hu-Oq for qemu-devel@nongnu.org; Mon, 02 May 2016 13:15:37 -0400 References: <1462052936-16933-1-git-send-email-eblake@redhat.com> <20160502153529.GE4882@noname.redhat.com> <57277583.1030209@redhat.com> From: Eric Blake Message-ID: <57278B08.3080909@redhat.com> Date: Mon, 2 May 2016 11:14:48 -0600 MIME-Version: 1.0 In-Reply-To: <57277583.1030209@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="p9H5joE21NamjnbVd7xLvLim8wktkpMnM" Subject: Re: [Qemu-devel] [PATCH] block: Don't lose FUA flag during ZERO_WRITE fallback List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Fam Zheng , "open list:Block I/O path" , qemu-stable@nongnu.org, qemu-devel@nongnu.org, Max Reitz , Stefan Hajnoczi , Paolo Bonzini This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --p9H5joE21NamjnbVd7xLvLim8wktkpMnM Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/02/2016 09:42 AM, Eric Blake wrote: > On 05/02/2016 09:35 AM, Kevin Wolf wrote: >> Am 30.04.2016 um 23:48 hat Eric Blake geschrieben: >>> NBD has situations where it can support FUA but not ZERO_WRITE; >>> when that happens, the generic block layer fallback was losing >>> the FUA flag. The problem of losing flags unrelated to >>> ZERO_WRITE has been latent in bdrv_co_do_write_zeroes() since >>> aa7bfbff, but back then, it did not matter because there was no >>> FUA flag. But ever since 93f5e6d8 added bdrv_co_writev_flags(), >>> the loss of flags can impact correctness. >>> >=20 >> then we still don't get the necessary flush unless the driver's >> .bdrv_co_write_zeroes() implementation explicitly handles FUA. As far = as >> I know, we don't have any driver that implements FUA there. >=20 > NBD will, once we get to that part of my series. And looking further, it looks like SCSI does NOT support FUA during WRITESAME(10/16), only during WRITE(10/16). Which means we probably want to start having both .supported_write_flags AND =2Esupported_write_zero flags, so that at least the iscsi driver can properly report that it does NOT natively support FUA on a write_zeroes request. >=20 > But I see what you're saying: since we already emulate FUA for all > drivers where .supported_write_flags does not include BDRV_REQ_FUA > during bdrv_driver_pwritev(), we should also emulate it here for all th= e > same drivers (and any driver that DOES advertise BDRV_REQ_FUA as > supported as well as a write_zeroes callback should be fixed to honor > it). I'll do that in v2, which I guess means I should post it at the > same time as my work for making .supported_write_flags a per-bds rather= > than per-driver designation. It also looks like SCSI would benefit from a per-bds supported_write_flags, as our iscsi_modesense_sync() is setting iscsilun->dpofua conditionally; likewise, iscsi_co_writev_flags blindly ignores BDRV_REQ_FUA if iscsilun->dpofua is not set. Which means that not all ISCSI devices support the FUA bit in WRITE(10/16) requests, and that therefore we should not be blindly assuming that FUA worked on those devices where it was not sensed. So just like NBD, iscsi has cases where we need an automatic FUA fallback at the block layer, regardless of whether we also need the fallback for WRITESAME(10/16). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --p9H5joE21NamjnbVd7xLvLim8wktkpMnM 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/ iQEcBAEBCAAGBQJXJ4sIAAoJEKeha0olJ0NqQi0H/0CzKXUyo2eNlw8e7J8cAfQD 3d9fQhKMJrGnLEuTHL9WNt2Bq1mBuWM6t6OsrSqOQuEY+fsGzO56r7oPVILFlYHJ f5RvVjA068kKbKdjua+5zTIghhVP35h2zaHDJxQ2j9rZweDX0jKcOxt2qBDmLDLp j/mOLEHNeFj3nbPOgDphS1mYsEaXo73D55zcEsRmerSAVor0d5mZdytMh1/JgNmU 2t2TfFYdXehURBBjS8TE6v6IRtss6uzB6IxF1inBI8qsz19p51DdTArBcGw0acFu doshXta/nfKUyClcEaApFq9cj7zMoIrMOXYXSA3lB6irjBeQOCIe8NQHC+TuWgo= =wYwy -----END PGP SIGNATURE----- --p9H5joE21NamjnbVd7xLvLim8wktkpMnM--