From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPa8y-00067b-Fw for qemu-devel@nongnu.org; Fri, 27 Sep 2013 11:39:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VPa8r-0007NK-6P for qemu-devel@nongnu.org; Fri, 27 Sep 2013 11:39:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15688) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPa8q-0007N5-Vl for qemu-devel@nongnu.org; Fri, 27 Sep 2013 11:39:41 -0400 From: Kevin Wolf Date: Fri, 27 Sep 2013 17:39:04 +0200 Message-Id: <1380296370-14523-5-git-send-email-kwolf@redhat.com> In-Reply-To: <1380296370-14523-1-git-send-email-kwolf@redhat.com> References: <1380296370-14523-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 04/30] qcow2: Don't shadow return value List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Max Reitz When trying to update the refcounts for a snapshot, the return value of update_refcount on a compressed cluster was pretty much ignored, cancelling the update on error but returning 0. This is caused by an inner "ret" variable shadowing the outer one (the latter is used in the return statement). Signed-off-by: Max Reitz Signed-off-by: Kevin Wolf --- block/qcow2-refcount.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 4264148..d2b7064 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -874,7 +874,6 @@ int qcow2_update_snapshot_refcount(BlockDriverState *bs, nb_csectors = ((offset >> s->csize_shift) & s->csize_mask) + 1; if (addend != 0) { - int ret; ret = update_refcount(bs, (offset & s->cluster_offset_mask) & ~511, nb_csectors * 512, addend, -- 1.8.1.4