Received: from eggs.gnu.org ([2001:4830:134:3::10]:59863) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjZ44-0003Nu-Gr for qemu-devel@nongnu.org; Mon, 12 Sep 2016 17:46:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjZ42-0003Xy-In for qemu-devel@nongnu.org; Mon, 12 Sep 2016 17:46:55 -0400 References: <1473424308-19812-1-git-send-email-den@openvz.org> <1473424308-19812-3-git-send-email-den@openvz.org> From: Eric Blake Message-ID: Date: Mon, 12 Sep 2016 16:46:45 -0500 MIME-Version: 1.0 In-Reply-To: <1473424308-19812-3-git-send-email-den@openvz.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="efUnNI4M6IQajQGopEK5Wh8RviExOMrn6" Subject: Re: [Qemu-devel] [PATCH 2/2] mirror: fix improperly filled copy_bitmap for mirror block job List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Denis V. Lunev" , qemu-block@nongnu.org Cc: Kevin Wolf , Fam Zheng , Jeff Cody , qemu-devel@nongnu.org, Max Reitz , Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --efUnNI4M6IQajQGopEK5Wh8RviExOMrn6 From: Eric Blake To: "Denis V. Lunev" , qemu-block@nongnu.org Cc: Kevin Wolf , Fam Zheng , Jeff Cody , qemu-devel@nongnu.org, Max Reitz , Stefan Hajnoczi Message-ID: Subject: Re: [Qemu-devel] [PATCH 2/2] mirror: fix improperly filled copy_bitmap for mirror block job References: <1473424308-19812-1-git-send-email-den@openvz.org> <1473424308-19812-3-git-send-email-den@openvz.org> In-Reply-To: <1473424308-19812-3-git-send-email-den@openvz.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/09/2016 07:31 AM, Denis V. Lunev wrote: > bdrv_is_allocated_above() returns true in the case even for completel s/completel/completely/ > zeroed areas as BDRV_BLOCK_ALLOCATED flag is set in both cases. >=20 > The patch stops using bdrv_is_allocated_above() wrapper and switches to= > bdrv_get_block_status_above() to distinguish zeroed areas and areas wit= h > data to avoid extra IO operations if possible. >=20 > Signed-off-by: Denis V. Lunev > CC: Stefan Hajnoczi > CC: Fam Zheng > CC: Kevin Wolf > CC: Max Reitz > CC: Jeff Cody > --- > block/mirror.c | 18 ++++++++++++------ > 1 file changed, 12 insertions(+), 6 deletions(-) >=20 > @@ -597,13 +602,14 @@ static int coroutine_fn mirror_dirty_init(MirrorB= lockJob *s) > return 0; > } > =20 > - ret =3D bdrv_is_allocated_above(bs, base, sector_num, nb_secto= rs, &n); > - if (ret < 0) { > - return ret; > + status =3D bdrv_get_block_status_above(bs, base, sector_num, > + nb_sectors, &n, &file); Eventually, we should probably fix bdrv_get_block_status_above() to be byte-based, but that's not a problem with this patch. Looks okay to me, but I haven't thought closely enough about potential corner cases to feel comfortable with giving R-b yet... --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --efUnNI4M6IQajQGopEK5Wh8RviExOMrn6 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/ iQEcBAEBCAAGBQJX1yJFAAoJEKeha0olJ0NqmPAH/RN8A546Xtw2Ksq0/S3VB3at ciwwRMZgd3xCVs+tYSj/Yb/Pqa5xKjoAG8xqjuVitfQqCfWeME6heCQtjMvyUEEO zYgKl1jH5/dlzcupkv0l0FQRI3sRMTtvzt+Rqyw7ih7xr/GCQ1dlFoMmgJIv9NN6 NIJfUUJFVen6SYrI6nhARcTXJJpjMOF8fQ2vmG/b3eASG3T190SG0FkFrLbuY1wf XNvubkp25SDGYUkavTC+6TB0BfujKcoKtnKi/+pLmqlaOEQCBcUHZtrVYnTpWJQQ nO7lOt51wdMfamlTrpRwpITHZztLurPIdkdC1u7aCBqUTxE+Ts2uef6mvZ/nCrs= =HGse -----END PGP SIGNATURE----- --efUnNI4M6IQajQGopEK5Wh8RviExOMrn6--