From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52803) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgbgT-0002ia-Oe for qemu-devel@nongnu.org; Wed, 13 Nov 2013 09:44:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VgbgO-0001wH-GP for qemu-devel@nongnu.org; Wed, 13 Nov 2013 09:44:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60499) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgbgO-0001w4-6l for qemu-devel@nongnu.org; Wed, 13 Nov 2013 09:44:40 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rADEicVG027997 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 13 Nov 2013 09:44:39 -0500 Message-ID: <52839055.9060705@redhat.com> Date: Wed, 13 Nov 2013 07:44:37 -0700 From: Eric Blake MIME-Version: 1.0 References: <1384346626-27479-1-git-send-email-kwolf@redhat.com> In-Reply-To: <1384346626-27479-1-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0lMRdo6rddBvdiKHWduuo2rVT0r0EinSH" Subject: Re: [Qemu-devel] [PATCH v3] qemu-img: Fix overwriting 'ret' before using List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-devel@nongnu.org Cc: mrezanin@redhat.com, akong@redhat.com, famz@redhat.com, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --0lMRdo6rddBvdiKHWduuo2rVT0r0EinSH Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 11/13/2013 05:43 AM, Kevin Wolf wrote: > From: Fam Zheng >=20 > This patch moves ret assignment after reporting original error. >=20 > We were lucky to pass qemu-iotests 048 (qemu-img compare case) but when= > I tried to run with TEST_DIR=3D/tmp (tmpfs), it fails with a "wrong" > mismatch offset. This fixes two bugs. >=20 > In the first if branch, setting ret to 1 before using it makes dead cod= e > in the next line: pnum is never added to mismatch offset even if ret wa= s > 0. >=20 > In the other if branch, currently the output error is always -4: > strerror(-4) -> Unknown error -4 >=20 > Added regression test in case 048. >=20 > Signed-off-by: Fam Zheng > Signed-off-by: Amos Kong > Signed-off-by: Kevin Wolf > --- >=20 > There was another case of overwritten ret that I added in v3. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --0lMRdo6rddBvdiKHWduuo2rVT0r0EinSH 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.15 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSg5BVAAoJEKeha0olJ0NqOmsH/009NXJE1EAVmCt9XamrhsSb lk4WKjUuh1kC5umTFaEKMybMeXYD4kMSnB6WDKIa+LZEu3JelXN6l3kfzjmgQy6s Cesr9jlsHHFP3yjlDGrvsY1sXRhGn5yPOWeaCTtl+oOJpO1wpAWwSnv8TB+JJ+Gi Cug27NGirX/1wWmHSCffCUo6XetFkAeriYatpHu6lNdzPdigdIJvFicMuA/I46Lt a9OBeR41HSEOvFTiGAynHYPQwm13hVeHxtqVbbp8NDPnlg81lsVOOR4yp2x142qg 8iGG0oSkOp7WuRe2KfRNC715VUrtvh9Fy+VR0hwBLxAes5q6DC3SZi0SWL4o/3w= =mLeo -----END PGP SIGNATURE----- --0lMRdo6rddBvdiKHWduuo2rVT0r0EinSH--