From patchwork Tue Sep 6 15:39:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 113582 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8317CB6F71 for ; Wed, 7 Sep 2011 01:37:26 +1000 (EST) Received: from localhost ([::1]:37945 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0xiF-0001XB-HW for incoming@patchwork.ozlabs.org; Tue, 06 Sep 2011 11:37:23 -0400 Received: from eggs.gnu.org ([140.186.70.92]:54921) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0xhu-0001Fj-0Y for qemu-devel@nongnu.org; Tue, 06 Sep 2011 11:37:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R0xhn-0003iO-9F for qemu-devel@nongnu.org; Tue, 06 Sep 2011 11:37:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1105) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0xhn-0003iC-0W for qemu-devel@nongnu.org; Tue, 06 Sep 2011 11:36:55 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p86Far4Q001795 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 6 Sep 2011 11:36:53 -0400 Received: from dhcp-5-188.str.redhat.com (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p86FamTF015671; Tue, 6 Sep 2011 11:36:52 -0400 From: Kevin Wolf To: anthony@codemonkey.ws Date: Tue, 6 Sep 2011 17:39:18 +0200 Message-Id: <1315323586-23840-4-git-send-email-kwolf@redhat.com> In-Reply-To: <1315323586-23840-1-git-send-email-kwolf@redhat.com> References: <1315323586-23840-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 03/31] qcow2: Fix error cases to run depedent requests X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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);