From b2d109f2de90a1c7e8ddf62c8d9aa7f6b8492436 Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Fri, 2 May 2014 16:58:49 -0500 Subject: [PATCH 17/26] qcow2: Remove wrong metadata overlap check RH-Author: Max Reitz Message-id: <1399049936-13496-18-git-send-email-mreitz@redhat.com> Patchwork-id: 58663 O-Subject: [RHEL-6.6 qemu-kvm PATCH v3 17/24] qcow2: Remove wrong metadata overlap check Bugzilla: 1004420 RH-Acked-by: Laszlo Ersek RH-Acked-by: Kevin Wolf RH-Acked-by: Stefan Hajnoczi BZ: 1004420 In qcow2_write_compressed, if the compression fails, a normal cluster is written to disk. This is done through bdrv_write on the qcow2 BDS itself (using the guest offset), thus it is wrong to do a metadata overlap check before. Signed-off-by: Max Reitz Signed-off-by: Kevin Wolf (cherry picked from commit f9bff971436b5924ca3c3203c6a3dcd6437bd430) Signed-off-by: Max Reitz --- block/qcow2.c | 8 -------- 1 file changed, 8 deletions(-) Signed-off-by: Jeff E. Nelson --- block/qcow2.c | 8 -------- 1 files changed, 0 insertions(+), 8 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 1b2edad..1d922b0 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1325,14 +1325,6 @@ static int qcow2_write_compressed(BlockDriverState *bs, int64_t sector_num, if (ret != Z_STREAM_END || out_len >= s->cluster_size) { /* could not compress: write normal cluster */ - - ret = qcow2_pre_write_overlap_check(bs, QCOW2_OL_DEFAULT, - sector_num * BDRV_SECTOR_SIZE, - s->cluster_sectors * BDRV_SECTOR_SIZE); - if (ret < 0) { - goto fail; - } - ret = bdrv_write(bs, sector_num, buf, s->cluster_sectors); if (ret < 0) { goto fail; -- 1.7.1