From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Juan Quintela Date: Tue, 1 Jun 2010 16:11:26 +0200 Message-Id: <1275401486-10848-1-git-send-email-quintela@redhat.com> Subject: [Qemu-devel] [PATCH] propagate write_refcount_block_entries error List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com 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; } } -- 1.6.6.1