From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57751) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0Gfa-0006zV-04 for qemu-devel@nongnu.org; Fri, 19 Jul 2013 15:48:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V0GfY-0005RG-TT for qemu-devel@nongnu.org; Fri, 19 Jul 2013 15:48:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27857) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0GfY-0005Qw-MP for qemu-devel@nongnu.org; Fri, 19 Jul 2013 15:48:48 -0400 Message-ID: <51E99819.9040803@redhat.com> Date: Fri, 19 Jul 2013 13:48:41 -0600 From: Eric Blake MIME-Version: 1.0 References: <1373992168-26043-1-git-send-email-pbonzini@redhat.com> <1373992168-26043-15-git-send-email-pbonzini@redhat.com> In-Reply-To: <1373992168-26043-15-git-send-email-pbonzini@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hePoKlSNgCpwat29rHUGWsglTTnxtKd44" Subject: Re: [Qemu-devel] [PATCH v2 14/17] raw-posix: return get_block_status data and flags List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: famz@redhat.com, pl@kamp.de, qemu-devel@nongnu.org, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --hePoKlSNgCpwat29rHUGWsglTTnxtKd44 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/16/2013 10:29 AM, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini > --- > block/raw-posix.c | 17 ++++++++++------- > 1 file changed, 10 insertions(+), 7 deletions(-) >=20 > +++ b/block/raw-posix.c > @@ -1089,7 +1089,7 @@ static int64_t coroutine_fn raw_co_get_block_stat= us(BlockDriverState *bs, > int nb_sectors, int *pnum)= > { > off_t start, data, hole; > - int ret; > + int64_t ret; > =20 > ret =3D fd_open(bs); > if (ret < 0) { > @@ -1097,6 +1097,7 @@ static int64_t coroutine_fn raw_co_get_block_stat= us(BlockDriverState *bs, > } > =20 > start =3D sector_num * BDRV_SECTOR_SIZE; > + ret =3D BDRV_BLOCK_DATA | BDRV_BLOCK_OFFSET_VALID | start; off_t is a signed type; if you are compiling on a platform with 32-bit off_t, is it possible that you will get unintended sign extension for values of 'start' between 2 and 4 GB? Or are such files already impossible to open? [Or do we intentionally require off_t be 64-bits on all platforms we care about?] Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --hePoKlSNgCpwat29rHUGWsglTTnxtKd44 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.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJR6ZgZAAoJEKeha0olJ0NqFs8H+QGz8OpG5456x1fWiikg34v2 bwYnrY75I3DRnDbpAiaR2BZJsrvrsh3KWXwqiPhIB6OoeqPU74sFWuBkoDLFRvmZ oFW3Rnjsu0H7N6HW9nZJd5JcM7+HXqd7U3T1TxJJh7qifXQfZo5g4LRDsCbvhEdx 9ETpBSVGzoB6RbsrN+Y5cXUoF42FqwItzfWcBVWOZHUE9YzXQkCe5nDdBc9yj2T6 IjoVuGpaBN5eUlSofsFO3uzc6kgCl1WryF49iLPnuGXm/5zfyrgMAlLV9dPWRXur jU2Gnnj5TifYz7l9VSkHQDxD5finuFqu6LaRt2qUlU1iOEdJKpXTA46WTlp5eXo= =DfkO -----END PGP SIGNATURE----- --hePoKlSNgCpwat29rHUGWsglTTnxtKd44--