From 7454d600457f75f4fda6bf7be027fd3bcf7d5220 Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Tue, 24 Sep 2013 13:50:46 +0200 Subject: [PATCH] qcow2: Don't shadow return value 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 42641481426..d2b7064a029 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, -- 2.39.5