]> git.proxmox.com Git - qemu.git/commitdiff
qcow2: Fix error cases to run depedent requests
authorKevin Wolf <kwolf@redhat.com>
Thu, 1 Sep 2011 13:02:13 +0000 (15:02 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 6 Sep 2011 09:23:51 +0000 (11:23 +0200)
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>
block/qcow2.c

index f26f7b66dc5ecc590533f343cb5f7f6e1e473992..8aed31004d555cb4ca4d3eed936144a81b0388d5 100644 (file)
@@ -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);