From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52757) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ab9hG-0004Ph-8D for qemu-devel@nongnu.org; Wed, 02 Mar 2016 11:32:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ab9hF-0001Rx-Dh for qemu-devel@nongnu.org; Wed, 02 Mar 2016 11:32:22 -0500 References: From: Max Reitz Message-ID: <56D7158B.5050107@redhat.com> Date: Wed, 2 Mar 2016 17:32:11 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="EDIv22EVDhbUsRKLoCpcJaLKJC9qUkClV" Subject: Re: [Qemu-devel] [PATCH v3 1/1] block/sheepdog: fix argument passed to qemu_strtoul() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jeff Cody , qemu-block@nongnu.org Cc: kwolf@redhat.com, mitake.hitoshi@lab.ntt.co.jp, qemu-devel@nongnu.org, v.tolstov@selfip.ru, pbonzini@redhat.com, namei.unix@gmail.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --EDIv22EVDhbUsRKLoCpcJaLKJC9qUkClV Content-Type: multipart/mixed; boundary="pa0dX0lrcb2GIk155htHtr6ImN5ciFpwN" From: Max Reitz To: Jeff Cody , qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, kwolf@redhat.com, namei.unix@gmail.com, mitake.hitoshi@lab.ntt.co.jp, v.tolstov@selfip.ru, pbonzini@redhat.com Message-ID: <56D7158B.5050107@redhat.com> Subject: Re: [PATCH v3 1/1] block/sheepdog: fix argument passed to qemu_strtoul() References: In-Reply-To: --pa0dX0lrcb2GIk155htHtr6ImN5ciFpwN Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 02.03.2016 17:24, Jeff Cody wrote: > The function qemu_strtoul() reads 'unsigned long' sized data, > which is larger than uint32_t on 64-bit machines. >=20 > Even though the snap_id field in the header is 32-bits, we must > accomodate the full size in qemu_strtoul(). >=20 > This patch also adds more meaningful error handling to the > qemu_strtoul() call, and subsequent results. >=20 > Reported-by: Paolo Bonzini > Signed-off-by: Jeff Cody > --- > block/sheepdog.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) Another problem with this function is that it doesn't always set errp on error. Actually, this patch introduces the first instance where it does. qemu-img will not print an error if errp is not set; it actually ignores bdrv_snapshot_delete_by_id_or_name()'s return value. So this is a real issue that should be fixed as well. Max --pa0dX0lrcb2GIk155htHtr6ImN5ciFpwN-- --EDIv22EVDhbUsRKLoCpcJaLKJC9qUkClV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJW1xWLAAoJEDuxQgLoOKytAQwH/A23V+J4xYSK+VSKOmY7fOY7 TdguHEFknw8fddAyauj8BstB5ifhnkD6x684rfPIFGFPz/GyyNmipmqjgx7BY5Az kEgbi0ZzPp9oKAoXxPih84EBx26UBBmyIrUJ0rQubA+m6X/+rE6BF6EX/xedlp9s HnBXaZukOpCOF0Zy49TAM2HNiqYldu1q7/wovJ0EpDtR6osQ/+DWNe+gZGiAkCZt AanTIQTX7PeCfkaC0GnryEv1VOyofEwsBYf5LImjx5HX2g+THkk82nKtkA3w1Rp5 9yRCYowFhh3sXvqo+w15Ul4AMSofvKZM/QauPCe68RWc/FSgCYoeiJBmIgPPjF0= =hrpp -----END PGP SIGNATURE----- --EDIv22EVDhbUsRKLoCpcJaLKJC9qUkClV--