qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, lcapitulino@redhat.com
Subject: [Qemu-devel] [PATCH 2/3] qcow2: Fix error cases to run depedent requests
Date: Thu,  1 Sep 2011 16:31:10 +0200	[thread overview]
Message-ID: <1314887471-18052-3-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1314887471-18052-1-git-send-email-kwolf@redhat.com>

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 |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/block/qcow2.c b/block/qcow2.c
index f26f7b6..8aed310 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);
-- 
1.7.6

  parent reply	other threads:[~2011-09-01 14:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-01 14:31 [Qemu-devel] [PATCH 0/3] qcow2/coroutine fixes Kevin Wolf
2011-09-01 14:31 ` [Qemu-devel] [PATCH 1/3] qcow2: Properly initialise QcowL2Meta Kevin Wolf
2011-09-01 14:31 ` Kevin Wolf [this message]
2011-09-01 14:31 ` [Qemu-devel] [PATCH 3/3] async: Allow nested qemu_bh_poll calls Kevin Wolf
2011-09-02  8:33   ` Stefan Hajnoczi
2011-09-01 16:19 ` [Qemu-devel] [PATCH 0/3] qcow2/coroutine fixes Luiz Capitulino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1314887471-18052-3-git-send-email-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).