From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xc56l-0002YM-VC for qemu-devel@nongnu.org; Thu, 09 Oct 2014 00:13:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xc56h-0007ke-0S for qemu-devel@nongnu.org; Thu, 09 Oct 2014 00:13:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29834) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xc56g-0007k6-OY for qemu-devel@nongnu.org; Thu, 09 Oct 2014 00:13:38 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s994Db3n009162 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 9 Oct 2014 00:13:37 -0400 Message-ID: <54360B70.4010104@redhat.com> Date: Wed, 08 Oct 2014 22:13:36 -0600 From: Eric Blake MIME-Version: 1.0 References: <1411400179-10605-1-git-send-email-mreitz@redhat.com> <1411400179-10605-2-git-send-email-mreitz@redhat.com> In-Reply-To: <1411400179-10605-2-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vJJ8Mk7oF5obqKqEnDmGuT2uWXsL5Vvtl" Subject: Re: [Qemu-devel] [PATCH v2 1/2] raw-posix: Fix raw_co_get_block_status() after EOF List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: Kevin Wolf , Paolo Bonzini , Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --vJJ8Mk7oF5obqKqEnDmGuT2uWXsL5Vvtl Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/22/2014 09:36 AM, Max Reitz wrote: > As its comment states, raw_co_get_block_status() should unconditionally= > return 0 and set *pnum to 0 for after EOF. >=20 > An assertion after lseek(..., SEEK_HOLE) tried to catch this case by > asserting that errno !=3D -ENXIO (which would indicate a position after= > the EOF); but it should be errno !=3D ENXIO instead. Fix this, too. >=20 > Additionally, nb_sectors should be clamped against the image end. This > was probably not an issue if FIEMAP or SEEK_HOLE/SEEK_DATA worked, but > the fallback did not take this case into account. >=20 > Reported-by: Kevin Wolf > Signed-off-by: Max Reitz > --- > block/raw-posix.c | 12 ++++++++++-- > 1 file changed, 10 insertions(+), 2 deletions(-) >=20 Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --vJJ8Mk7oF5obqKqEnDmGuT2uWXsL5Vvtl 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 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJUNgtwAAoJEKeha0olJ0NqzDUIAIA+8zfrijm0fNGQJgFtZ4mD YkBTAX5FjzWeIAbgKCadl2Z8U6iC+jBPm5KJa/9m3+3hLgn1XhdWp561tHiED6rP EUaPYWsCkA98o5bCFDtETzuWCI3zAw5FrGQuJwnSJOHwyOrGZdl9xblRbh9xt4ck RArkSHSlAz6BRedFLg+29zdSX/IvZABy0JAl+W19R/hJBcOG++daV3NMOmfi45kc 1EJPfhGN9YjSBTS+p/BW2mY2jHG69r7XIDN6zb7qxlA+a5/EOB5DnOYcS7kNqLCU UPhDe5u2mrKR1C1qw2Eig69kCk43yO1Apv1bRmzaZU+HBhLpDGQvyeZrOh0aatU= =K86z -----END PGP SIGNATURE----- --vJJ8Mk7oF5obqKqEnDmGuT2uWXsL5Vvtl--