Received: from eggs.gnu.org ([2001:4830:134:3::10]:47517) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cDqvF-0001NU-O8 for qemu-devel@nongnu.org; Mon, 05 Dec 2016 05:55:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cDqvC-0006ry-M7 for qemu-devel@nongnu.org; Mon, 05 Dec 2016 05:55:01 -0500 Date: Mon, 5 Dec 2016 10:54:54 +0000 From: Stefan Hajnoczi Message-ID: <20161205105454.GD22443@stefanha-x1.localdomain> References: <20161203173402.12537-1-eblake@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Xm/fll+QQv+hsKip" Content-Disposition: inline In-Reply-To: <20161203173402.12537-1-eblake@redhat.com> Subject: Re: [Qemu-devel] [Qemu-block] [PATCH for-2.8] qcow2: Don't strand clusters near 2G intervals during commit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, kwolf@redhat.com, qemu-block@nongnu.org, Max Reitz --Xm/fll+QQv+hsKip Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 03, 2016 at 11:34:02AM -0600, Eric Blake wrote: > The qcow2_make_empty() function is reached during 'qemu-img commit', > in order to clear out ALL clusters of an image. However, if the > image cannot use the fast code path (true if the image is format > 0.10, or if the image contains a snapshot), the cluster size is > larger than 512, and the image is larger than 2G in size, then our > choice of sector_step causes problems. Since it is not cluster > aligned, but qcow2_discard_clusters() silently ignores an unaligned > head or tail, we are leaving clusters allocated. >=20 > Enhance the testsuite to expose the flaw, and patch the problem by > ensuring our step size is aligned. >=20 > [qcow2_discard_clusters() is a GROSS interface: it takes a mix of > byte offset and sector count to perform cluster operations. But > fixing it to use a saner byte/byte rather than byte/sector interface, > and/or asserting that the counts are now aligned thanks to both > this patch and commit 3482b9b, is material for another day.] >=20 > Signed-off-by: Eric Blake > --- > block/qcow2.c | 3 +- > tests/qemu-iotests/097 | 41 +++++--- > tests/qemu-iotests/097.out | 249 +++++++++++++++++++++++++++++++++------= ------ > 3 files changed, 210 insertions(+), 83 deletions(-) Reviewed-by: Stefan Hajnoczi --Xm/fll+QQv+hsKip Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJYRUd+AAoJEJykq7OBq3PIpOUH/RvMBEDQk4YOwapZKrUdyPRn w66330jf174SbGrn4KsP1AOlXYN1nnRxUQJ8S5gLUlbc0356EswQ7GZXMWoMIlPS zsgdsXNCWOylkmO+pg5SIL/UCVOLmleTaYOriGuGOIuvbMGulNwvSM1z5rDLL9IG e8MQhn8ZQ4yTcalUAuix/6tww5hQcwLGUVFCKJn9HAdYkNDgmyqIXNVDplj8CSDM Iqv4tQwfY0l2Zo4yBtKyqxufbmar0VHAosDO/sBchVgpA2V62hJcUlsyphI3lwMV bupuXexjfrGax70ChIoVWTNMvk8AKb02lag3OAZX+uE8JJRZeFalfmM2AQ2+dFY= =LPAL -----END PGP SIGNATURE----- --Xm/fll+QQv+hsKip--