From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuJSC-00031M-RJ for qemu-devel@nongnu.org; Fri, 28 Nov 2014 06:11:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XuJS3-0002HP-Pj for qemu-devel@nongnu.org; Fri, 28 Nov 2014 06:11:12 -0500 Received: from mail-wi0-x231.google.com ([2a00:1450:400c:c05::231]:37943) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuJS3-0002HJ-Iz for qemu-devel@nongnu.org; Fri, 28 Nov 2014 06:11:03 -0500 Received: by mail-wi0-f177.google.com with SMTP id l15so10860873wiw.10 for ; Fri, 28 Nov 2014 03:11:03 -0800 (PST) Date: Fri, 28 Nov 2014 11:11:00 +0000 From: Stefan Hajnoczi Message-ID: <20141128111100.GC13631@stefanha-thinkpad.redhat.com> References: <1416503198-17031-1-git-send-email-mreitz@redhat.com> <1416503198-17031-8-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jy6Sn24JjFx/iggw" Content-Disposition: inline In-Reply-To: <1416503198-17031-8-git-send-email-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 07/22] qcow2: Helper function for refcount modification List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi --jy6Sn24JjFx/iggw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Nov 20, 2014 at 06:06:23PM +0100, Max Reitz wrote: > @@ -1711,7 +1746,7 @@ static int calculate_refcounts(BlockDriverState *bs, BdrvCheckResult *res, > static void compare_refcounts(BlockDriverState *bs, BdrvCheckResult *res, > BdrvCheckMode fix, bool *rebuild, > int64_t *highest_cluster, > - uint16_t *refcount_table, int64_t nb_clusters) > + void *refcount_table, int64_t nb_clusters) > { > BDRVQcowState *s = bs->opaque; > int64_t i, refcount1, refcount2; An -ERANGE qcow2_get_refcount() return value is treated as a check error here and we won't be able to rebuild the refcount blocks: refcount1 = qcow2_get_refcount(bs, i); if (refcount1 < 0) { fprintf(stderr, "Can't get refcount for cluster %" PRId64 ": %s\n", i, strerror(-refcount1)); res->check_errors++; continue; } We should allow rebuilding refcount blocks, -ERANGE is just another corrupted refcount. --jy6Sn24JjFx/iggw Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUeFhEAAoJEJykq7OBq3PIMAAH/0eO3qJz8UfbpPtL/UTVsiSy xrlKngHmEK5wfGotXrpQtkAzN22eB/AC68dX/pb3CJUSfJmVvGiBbaXUGgwqAYqR cpap97exe9RTntNgkiaXcpiWRXe3GQ2aUgEvgH16addF4VYR7329CLp0VAmEeuuQ fRE2zQf+EujGlBveMMOQz7xMBZVeyIG6naMR9yzGAOcEZtnLrASJ7ztp2JlTbyqN jfJm0y9NZDrRjcTXqUPqF8SADjivtwqy1z5HSMWCso3hLITFGQuktfJW0tdKu+T+ oLdu7NTipB0p/m7B6ZcaX33w5ADu1yzKHKDcogQCsEF9rIU+kWgmDpVLv7KHvHI= =ruJa -----END PGP SIGNATURE----- --jy6Sn24JjFx/iggw--