From 7b8d178f166445a0a3bf0418a21f520b65d23249 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Tue, 14 Feb 2012 11:14:37 +0100 Subject: [PATCH 72/99] qcow2: Fix error cases to run depedent requests RH-Author: Kevin Wolf Message-id: <1329218101-24213-73-git-send-email-kwolf@redhat.com> Patchwork-id: 37271 O-Subject: [RHEL-6.3 qemu-kvm PATCH v2 72/96] qcow2: Fix error cases to run depedent requests Bugzilla: 783950 RH-Acked-by: Paolo Bonzini RH-Acked-by: Marcelo Tosatti RH-Acked-by: Laszlo Ersek Bugzilla: 783950 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 (cherry picked from commit 0fa9131a44943cc14c931a23eee040da4cc0c454) --- block/qcow2.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Signed-off-by: Michal Novotny --- block/qcow2.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 7fc2a32..28cebb1 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -591,13 +591,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; @@ -605,6 +604,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); -- 1.7.7.5