diff options
author | Kevin Wolf <kwolf@redhat.com> | 2010-04-06 18:24:07 +0200 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2010-04-10 00:39:35 +0200 |
commit | 7eb58a6c556c3880e6712cbf6d24d681261c5095 (patch) | |
tree | 5637f04646ae1ba43672ac6c16cf50a853f17b29 | |
parent | 0f0b604b00851f2c7160b4195136c1fd27418088 (diff) |
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>
-rw-r--r-- | block.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1884,7 +1884,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 { |