aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2010-04-06 18:24:07 +0200
committerAurelien Jarno <aurelien@aurel32.net>2010-04-10 01:15:54 +0200
commit4622317288507449ec7b9af344c265dd20c96b3a (patch)
treeeed4764199a1a9b20042401d60b7950b0d0c498c
parentblock: Fix error code in multiwrite for immediate failures (diff)
downloadqemu-kvm-4622317288507449ec7b9af344c265dd20c96b3a.tar.gz
qemu-kvm-4622317288507449ec7b9af344c265dd20c96b3a.tar.bz2
qemu-kvm-4622317288507449ec7b9af344c265dd20c96b3a.zip
block: Fix multiwrite memory leak in error case
Previously multiwrite_user_cb was never called if a request in the multiwrite batch failed right away because it did set mcb->error immediately. Make it look more like a normal callback to fix this. Reported-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit 7eb58a6c556c3880e6712cbf6d24d681261c5095)
-rw-r--r--block.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block.c b/block.c
index d537d10b6..4f9a48b71 100644
--- a/block.c
+++ b/block.c
@@ -1761,7 +1761,8 @@ int bdrv_aio_multiwrite(BlockDriverState *bs, BlockRequest *reqs, int num_reqs)
reqs[i].error = -EIO;
goto fail;
} else {
- mcb->error = -EIO;
+ mcb->num_requests++;
+ multiwrite_cb(mcb, -EIO);
break;
}
} else {