From patchwork Tue Apr 6 13:30:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 49517 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 67B49B7D24 for ; Tue, 6 Apr 2010 23:41:39 +1000 (EST) Received: from localhost ([127.0.0.1]:50763 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nz928-0006BK-8c for incoming@patchwork.ozlabs.org; Tue, 06 Apr 2010 09:41:36 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nz8s8-0002TZ-Ao for qemu-devel@nongnu.org; Tue, 06 Apr 2010 09:31:16 -0400 Received: from [140.186.70.92] (port=34575 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nz8rv-0002Mh-Du for qemu-devel@nongnu.org; Tue, 06 Apr 2010 09:31:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nz8rs-0006ss-IV for qemu-devel@nongnu.org; Tue, 06 Apr 2010 09:31:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30829) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nz8rs-0006sO-7o for qemu-devel@nongnu.org; Tue, 06 Apr 2010 09:31:00 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o36DUwBd021664 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 6 Apr 2010 09:30:58 -0400 Received: from localhost.localdomain (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o36DUixK011039; Tue, 6 Apr 2010 09:30:55 -0400 From: Kevin Wolf To: qemu-devel@nongnu.org Date: Tue, 6 Apr 2010 15:30:11 +0200 Message-Id: <1270560614-31030-4-git-send-email-kwolf@redhat.com> In-Reply-To: <1270560614-31030-1-git-send-email-kwolf@redhat.com> References: <1270560614-31030-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: kwolf@redhat.com Subject: [Qemu-devel] [PATCH 3/6] qcow2: Fix error return code in qcow2_alloc_cluster_link_l2 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 Fix qcow2_alloc_cluster_link_l2 to return the real error code like it does in all other error cases. Signed-off-by: Kevin Wolf --- block/qcow2-cluster.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index 65b16db..8cc742b 100644 --- a/block/qcow2-cluster.c +++ b/block/qcow2-cluster.c @@ -687,8 +687,8 @@ int qcow2_alloc_cluster_link_l2(BlockDriverState *bs, QCowL2Meta *m) (i << s->cluster_bits)) | QCOW_OFLAG_COPIED); } - if (write_l2_entries(s, l2_table, l2_offset, l2_index, m->nb_clusters) < 0) { - ret = -1; + ret = write_l2_entries(s, l2_table, l2_offset, l2_index, m->nb_clusters); + if (ret < 0) { goto err; }