提交 7eb58a6c 编写于 作者: K Kevin Wolf 提交者: Aurelien Jarno

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: NJuan Quintela <quintela@redhat.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
上级 0f0b604b
...@@ -1884,7 +1884,8 @@ int bdrv_aio_multiwrite(BlockDriverState *bs, BlockRequest *reqs, int num_reqs) ...@@ -1884,7 +1884,8 @@ int bdrv_aio_multiwrite(BlockDriverState *bs, BlockRequest *reqs, int num_reqs)
reqs[i].error = -EIO; reqs[i].error = -EIO;
goto fail; goto fail;
} else { } else {
mcb->error = -EIO; mcb->num_requests++;
multiwrite_cb(mcb, -EIO);
break; break;
} }
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册