From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52703) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOR8q-0000WN-FS for qemu-devel@nongnu.org; Tue, 24 Sep 2013 07:51:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VOR8k-0003K5-At for qemu-devel@nongnu.org; Tue, 24 Sep 2013 07:50:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53525) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOR8k-0003Jw-1j for qemu-devel@nongnu.org; Tue, 24 Sep 2013 07:50:50 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8OBomOu032104 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 24 Sep 2013 07:50:48 -0400 From: Max Reitz Date: Tue, 24 Sep 2013 13:50:46 +0200 Message-Id: <1380023446-18176-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH] qcow2: Don't shadow return value List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi , 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 --- 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.3.1