From patchwork Tue Jun 1 14:11:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 54212 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9FA82B7D16 for ; Wed, 2 Jun 2010 00:26:40 +1000 (EST) Received: from localhost ([127.0.0.1]:52383 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJSQO-0003In-0u for incoming@patchwork.ozlabs.org; Tue, 01 Jun 2010 10:26:36 -0400 Received: from [140.186.70.92] (port=55371 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJSD5-0003L0-DG for qemu-devel@nongnu.org; Tue, 01 Jun 2010 10:12:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJSBm-0000z5-G3 for qemu-devel@nongnu.org; Tue, 01 Jun 2010 10:11:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43612) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJSBm-0000ym-9G for qemu-devel@nongnu.org; Tue, 01 Jun 2010 10:11:30 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o51EBS2l032121 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 1 Jun 2010 10:11:29 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o51EBRVN000879; Tue, 1 Jun 2010 10:11:27 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Tue, 1 Jun 2010 16:11:26 +0200 Message-Id: <1275401486-10848-1-git-send-email-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: kwolf@redhat.com Subject: [Qemu-devel] [PATCH] propagate write_refcount_block_entries error X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Juan Quintela --- block/qcow2-refcount.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 744107c..4226dce 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -460,10 +460,10 @@ static int QEMU_WARN_UNUSED_RESULT update_refcount(BlockDriverState *bs, table_index = cluster_index >> (s->cluster_bits - REFCOUNT_SHIFT); if ((old_table_index >= 0) && (table_index != old_table_index)) { - if (write_refcount_block_entries(bs, refcount_block_offset, - first_index, last_index) < 0) - { - return -EIO; + ret = write_refcount_block_entries(bs, refcount_block_offset, + first_index, last_index); + if (ret < 0) { + return ret; } first_index = -1; @@ -505,10 +505,10 @@ fail: /* Write last changed block to disk */ if (refcount_block_offset != 0) { - if (write_refcount_block_entries(bs, refcount_block_offset, - first_index, last_index) < 0) - { - return ret < 0 ? ret : -EIO; + int write_ret = write_refcount_block_entries(bs, refcount_block_offset, + first_index, last_index); + if (write_ret < 0){ + return ret < 0 ? ret : write_ret; } }