From f4a8483162a06e290c812c834bd262fc839c049f Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Tue, 4 May 2010 13:30:35 -0300 Subject: [PATCH 13/20] qcow2: Fix error return code in qcow2_alloc_cluster_link_l2 RH-Author: Kevin Wolf Message-id: <1272979838-20032-7-git-send-email-kwolf@redhat.com> Patchwork-id: 8998 O-Subject: [RHEL-6 qemu-kvm PATCH 6/9] qcow2: Fix error return code in qcow2_alloc_cluster_link_l2 Bugzilla: 588762 RH-Acked-by: Gleb Natapov RH-Acked-by: Juan Quintela RH-Acked-by: Christoph Hellwig Bugzilla: 588762 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 (cherry picked from commit c835d00fc8d6c23af7e9182981ef7a07f1c6d12c) Signed-off-by: Kevin Wolf --- block/qcow2-cluster.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Signed-off-by: Eduardo Habkost --- 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 2f37acd..d2774d1 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; } -- 1.7.0.3