From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46210) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8Rvj-0005K4-BA for qemu-devel@nongnu.org; Thu, 02 Jun 2016 08:40:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b8Rvi-0008F6-2l for qemu-devel@nongnu.org; Thu, 02 Jun 2016 08:40:55 -0400 References: <1464815413-613-1-git-send-email-eblake@redhat.com> <1464815413-613-10-git-send-email-eblake@redhat.com> <20160602111647.GD6867@noname.redhat.com> From: Eric Blake Message-ID: <5750294F.6030102@redhat.com> Date: Thu, 2 Jun 2016 06:40:47 -0600 MIME-Version: 1.0 In-Reply-To: <20160602111647.GD6867@noname.redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rjoKxKkJEi3GWPP6Xc0fNFG52AcHUJXdb" Subject: Re: [Qemu-devel] [PATCH v2 09/13] qed: Convert to bdrv_co_pwrite_zeroes() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, Stefan Hajnoczi , Max Reitz This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --rjoKxKkJEi3GWPP6Xc0fNFG52AcHUJXdb Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/02/2016 05:16 AM, Kevin Wolf wrote: > Am 01.06.2016 um 23:10 hat Eric Blake geschrieben: >> Another step on our continuing quest to switch to byte-based >> interfaces. >> >> Kill an abuse of the comma operator while at it (fortunately, >> the semantics were still right). Also, the test for requests >> not aligned to clusters should be applied always, not just >> when a backing file is present. >> >> Signed-off-by: Eric Blake >> --- >> block/qed.c | 33 +++++++++++++++------------------ >> 1 file changed, 15 insertions(+), 18 deletions(-) >> - } >> + /* Fall back if the request is not */ >=20 > ...aligned? Yes, thanks. >=20 >> + if (qed_offset_into_cluster(s, offset) || >> + qed_offset_into_cluster(s, count)) { >> + return -ENOTSUP; >> } >=20 > This is obviously correct and almost as obviously suboptimal compared t= o > the original version (we need cluster alignment with a backing file, bu= t > without a backing file, sector alignment would be enough). Does QED support per-sector zeroing, or is it only per-cluster zero like qcow2? /me checks the spec only per-cluster zeroing >=20 > But as this is QED, which is only supported for compatibility these > days, simpler if slightly suboptimal code is okay with me. Widening a request to cluster boundaries is only possible if you know the cluster is otherwise unallocated or already reads as zeroes, and unless qed tracks zero sectors (as opposed to zero clusters), I argue that this was actually a bug fix, even when the request was sector-aligned, since we lack the check for cluster remains unallocated/zero before widening, the way qcow2 does it. Sub-optimal but safe is better than incorrectly optimized. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --rjoKxKkJEi3GWPP6Xc0fNFG52AcHUJXdb 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/ iQEcBAEBCAAGBQJXUClPAAoJEKeha0olJ0NqA4MH/3UBum0+xJw0bKKlNn5McriC m/ELtiApPSdKoqUY1uEra48XQXDiQmOiKo3C8RcCnkBflnu7VJHL0ijNwwDHgW25 Aqsj7MR6Zx/h3j2FlHxoE5fxIrMzlc/+nXfWiFvlGzJuUj2uZdBi4tp1dlxehua7 PsY9FusrwyFCv4+sAtO9EqDQih4aR6p7UUzAcsuxtW1dPLeGPTTzOb+LKtyiAeUO zGjHOlq8ocEL0+AivldLJqDtJSMQoB5fghfb32o4Cx3BbZv9c8UuvurMaq+cVWDY LSzWknzTXLdcq+T6s37zj3lExKp92jtBEK1ETqj2qD2xJOSN/4yDINhchVJqAOI= =i+2o -----END PGP SIGNATURE----- --rjoKxKkJEi3GWPP6Xc0fNFG52AcHUJXdb--