From d4c5cca8a318b3755d34edb696843e8b43be2b01 Mon Sep 17 00:00:00 2001 From: Kevin Wolf <kwolf@redhat.com> Date: Fri, 18 Jun 2010 15:22:22 -0300 Subject: [PATCH 04/18] qcow2: Fix error return code in qcow2_alloc_cluster_link_l2 RH-Author: Kevin Wolf <kwolf@redhat.com> Message-id: <patch-9979-clone-for-rhel55-rhel55> Patchwork-id: 10053 O-Subject: [RHEL-5.6 KVM PATCH 04/16] qcow2: Fix error return code in qcow2_alloc_cluster_link_l2 Bugzilla: 612508 RH-Acked-by: Juan Quintela <quintela@redhat.com> RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com> RH-Acked-by: Christoph Hellwig <chellwig@redhat.com> RH-Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com> Bugzilla: 605701 Upstream commit: c835d00fc8d6c23af7e9182981ef7a07f1c6d12c 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 <kwolf@redhat.com> --- qemu/block-qcow2.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- qemu/block-qcow2.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu/block-qcow2.c b/qemu/block-qcow2.c index 0576aad..a594364 100644 --- a/qemu/block-qcow2.c +++ b/qemu/block-qcow2.c @@ -1097,8 +1097,8 @@ static int 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; } -- 1.7.0.3