aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2011-09-01 15:02:13 +0200
committerKevin Wolf <kwolf@redhat.com>2011-09-06 11:23:51 +0200
commit0fa9131a44943cc14c931a23eee040da4cc0c454 (patch)
tree8b8a8b9710534a0550f174cbb75674293cad2f60 /block
parent8e217d5384a38bdb4727c4e22d7ed64c351361f7 (diff)
qcow2: Fix error cases to run depedent requests
Requests depending on a failed request would end up waiting forever. This fixes the error path to continue dependent requests even when the request has failed. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/qcow2.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/block/qcow2.c b/block/qcow2.c
index f26f7b66dc..8aed31004d 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -593,13 +593,12 @@ static int qcow2_co_writev(BlockDriverState *bs,
}
ret = qcow2_alloc_cluster_link_l2(bs, &l2meta);
-
- run_dependent_requests(s, &l2meta);
-
if (ret < 0) {
goto fail;
}
+ run_dependent_requests(s, &l2meta);
+
remaining_sectors -= cur_nr_sectors;
sector_num += cur_nr_sectors;
bytes_done += cur_nr_sectors * 512;
@@ -607,6 +606,8 @@ static int qcow2_co_writev(BlockDriverState *bs,
ret = 0;
fail:
+ run_dependent_requests(s, &l2meta);
+
qemu_co_mutex_unlock(&s->lock);
qemu_iovec_destroy(&hd_qiov);