From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50724) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFOLr-0003lF-MN for qemu-devel@nongnu.org; Fri, 30 Aug 2013 09:03:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VFOLm-000299-QS for qemu-devel@nongnu.org; Fri, 30 Aug 2013 09:02:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFOLm-00028x-JE for qemu-devel@nongnu.org; Fri, 30 Aug 2013 09:02:54 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r7UD2qLd029540 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 30 Aug 2013 09:02:53 -0400 Message-ID: <522097FC.309@redhat.com> Date: Fri, 30 Aug 2013 07:02:52 -0600 From: Eric Blake MIME-Version: 1.0 References: <1377851804-13614-1-git-send-email-mreitz@redhat.com> <1377851804-13614-2-git-send-email-mreitz@redhat.com> In-Reply-To: <1377851804-13614-2-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pxOrRqrtkc18oxUS7Vk0vT9s31RqtNKnp" Subject: Re: [Qemu-devel] [PATCH v2 1/2] qcow2-refcount: Snapshot update for zero clusters List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --pxOrRqrtkc18oxUS7Vk0vT9s31RqtNKnp Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 08/30/2013 02:36 AM, Max Reitz wrote: > Account for all cluster types in qcow2_update_snapshot_refcounts; > this prevents this function from updating the refcount of unallocated > zero clusters which effectively led to wrong adjustments of the refcoun= t > of cluster 0 (the main qcow2 header). This in turn resulted in images > with (unallocated) zero clusters having a cluster 0 refcount greater > than one after creating a snapshot. >=20 > Signed-off-by: Max Reitz > --- > block/qcow2-refcount.c | 52 +++++++++++++++++++++++++++++++++---------= -------- > 1 file changed, 35 insertions(+), 17 deletions(-) >=20 > diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c > index 1244693..a61224a 100644 > --- a/block/qcow2-refcount.c > +++ b/block/qcow2-refcount.c > @@ -861,11 +861,14 @@ int qcow2_update_snapshot_refcount(BlockDriverSta= te *bs, > } > =20 > for(j =3D 0; j < s->l2_size; j++) { > + uint64_t cluster_index; As long as you're touching this code, it might be worth s/for(/for (/ in the line above. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --pxOrRqrtkc18oxUS7Vk0vT9s31RqtNKnp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSIJf8AAoJEKeha0olJ0NqY1wIAIjViNb5hIzedfrDutpXq6wl l/U1pkmLM6SJ9rt628h3Qzst3p9eRlE6z579GHl7yl7wnR98iGFWfWjZGrMZtJyo mIxAbbjS4UZ3NeWM06w/OoPSoKxXVQE8Ini62TnMzsMWw3WKzJIvDMjSvfIAjJlF jQJkgla31QntXKdLML1rMeCu/0QbOMjHlC6g4jDPQfUFmsSp1XZmilLLPsCrmdRw m7cr+yZwBVF3oY2k4622VDd5h0YBy/zsqeWpPR/ra01j0CLvyh0fPgayoCbL5eB0 bYsaQBaHOIVlDQ4pVLRImeXZYOYB8XLikU3Hk9dsBvxrM3q9ejxM2FnTA5zl7qk= =V2OQ -----END PGP SIGNATURE----- --pxOrRqrtkc18oxUS7Vk0vT9s31RqtNKnp--