From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36313) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEJl9-0003Hi-HR for qemu-devel@nongnu.org; Thu, 22 Jan 2015 10:33:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEJl6-0006WM-4n for qemu-devel@nongnu.org; Thu, 22 Jan 2015 10:33:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45473) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEJl5-0006W1-TF for qemu-devel@nongnu.org; Thu, 22 Jan 2015 10:33:24 -0500 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 t0MFXNvL005494 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 22 Jan 2015 10:33:23 -0500 Message-ID: <54C11842.8090303@redhat.com> Date: Thu, 22 Jan 2015 08:33:22 -0700 From: Eric Blake MIME-Version: 1.0 References: <1418647857-3589-1-git-send-email-mreitz@redhat.com> <1418647857-3589-6-git-send-email-mreitz@redhat.com> In-Reply-To: <1418647857-3589-6-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mJLdAI2DQ2w99srCWnvFK31u2s3go3SeK" Subject: Re: [Qemu-devel] [PATCH v5 05/26] qcow2: Use unsigned addend for update_refcount() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --mJLdAI2DQ2w99srCWnvFK31u2s3go3SeK Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/15/2014 05:50 AM, Max Reitz wrote: > update_refcount() and qcow2_update_cluster_refcount() currently take a > signed addend. At least one caller passes a value directly derived from= > an absolute refcount that should be reached ("l2_refcount - 1" in > expand_zero_clusters_in_l1()). Therefore, the addend should be unsigned= > because unsigned overflow is well-defined in contrast to signed > overflow. This will be especially important for 64 bit refcounts. >=20 > Because update_refcount() then no longer knows whether the refcount > should be increased or decreased (which is important for setting the > refblock-L2-table cache dependency and for overflow/underflow checks), > it now requires an additional flag which specified exactly that. The > same applies to qcow2_update_cluster_refcount(). >=20 > Signed-off-by: Max Reitz > --- > block/qcow2-cluster.c | 2 +- > block/qcow2-refcount.c | 65 ++++++++++++++++++++++++++++++++----------= -------- > block/qcow2.h | 3 ++- > 3 files changed, 45 insertions(+), 25 deletions(-) >=20 Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --mJLdAI2DQ2w99srCWnvFK31u2s3go3SeK 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 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJUwRhCAAoJEKeha0olJ0NqggEH/1cfllfW7jmTSdCvH++XeV7Q F/yNfLjoYWY6xWzYKknZvE2gV8/53I+SR7KrA4SrNLggpdZVMPcMuXChnUa4QGFZ aWg8/Votsi7B4gu7uHYvRjQ0at0VsRLYz2NTqLVtl+8NyeWHGyxzUSgiWr8/Vj87 JHdqtAtc6K54A1CPH1VHpF7zVO6qywdCx7EDIpEuNivIg92lrSXA/KVv675PuX6n m45UYDuycc/dUE2r8Dt6acMJdQ0mV/2r5IPld4k37Kt/smcu+Vo3fdIc9GOWFTWq DMpUqD1Vq+E88RXKRru8/n5LYVgjGS+S0OeQAZvW3De2KQ0QcfdjAAL14cljHgc= =NcBy -----END PGP SIGNATURE----- --mJLdAI2DQ2w99srCWnvFK31u2s3go3SeK--