aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2013-09-24 13:50:46 +0200
committerKevin Wolf <kwolf@redhat.com>2013-09-25 10:08:56 +0200
commit7454d600457f75f4fda6bf7be027fd3bcf7d5220 (patch)
tree94a2325b760f3dd48d9dd1e62db3d6a839475c13 /block
parentff42308f30e05155efc78a1f00f53943ca51e4f9 (diff)
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 <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/qcow2-refcount.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index 4264148142..d2b7064a02 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,