9ae3a8
From 4e3d25779bb06d9c7a39e9e36b1be8737b459e32 Mon Sep 17 00:00:00 2001
9ae3a8
From: Max Reitz <mreitz@redhat.com>
9ae3a8
Date: Mon, 4 Nov 2013 22:32:28 +0100
9ae3a8
Subject: [PATCH 35/87] qcow2: Remove wrong metadata overlap check
9ae3a8
9ae3a8
RH-Author: Max Reitz <mreitz@redhat.com>
9ae3a8
Message-id: <1383604354-12743-38-git-send-email-mreitz@redhat.com>
9ae3a8
Patchwork-id: 55337
9ae3a8
O-Subject: [RHEL-7.0 qemu-kvm PATCH 37/43] qcow2: Remove wrong metadata overlap check
9ae3a8
Bugzilla: 1004347
9ae3a8
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
9ae3a8
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
9ae3a8
RH-Acked-by: Fam Zheng <famz@redhat.com>
9ae3a8
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
9ae3a8
BZ: 1004347
9ae3a8
9ae3a8
In qcow2_write_compressed, if the compression fails, a normal cluster is
9ae3a8
written to disk. This is done through bdrv_write on the qcow2 BDS
9ae3a8
itself (using the guest offset), thus it is wrong to do a metadata
9ae3a8
overlap check before.
9ae3a8
9ae3a8
Signed-off-by: Max Reitz <mreitz@redhat.com>
9ae3a8
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
9ae3a8
(cherry picked from commit f9bff971436b5924ca3c3203c6a3dcd6437bd430)
9ae3a8
9ae3a8
Signed-off-by: Max Reitz <mreitz@redhat.com>
9ae3a8
---
9ae3a8
 block/qcow2.c | 8 --------
9ae3a8
 1 file changed, 8 deletions(-)
9ae3a8
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 block/qcow2.c |    8 --------
9ae3a8
 1 files changed, 0 insertions(+), 8 deletions(-)
9ae3a8
9ae3a8
diff --git a/block/qcow2.c b/block/qcow2.c
9ae3a8
index 880d2cf..8b73518 100644
9ae3a8
--- a/block/qcow2.c
9ae3a8
+++ b/block/qcow2.c
9ae3a8
@@ -1735,14 +1735,6 @@ static int qcow2_write_compressed(BlockDriverState *bs, int64_t sector_num,
9ae3a8
 
9ae3a8
     if (ret != Z_STREAM_END || out_len >= s->cluster_size) {
9ae3a8
         /* could not compress: write normal cluster */
9ae3a8
-
9ae3a8
-        ret = qcow2_pre_write_overlap_check(bs, QCOW2_OL_DEFAULT,
9ae3a8
-                sector_num * BDRV_SECTOR_SIZE,
9ae3a8
-                s->cluster_sectors * BDRV_SECTOR_SIZE);
9ae3a8
-        if (ret < 0) {
9ae3a8
-            goto fail;
9ae3a8
-        }
9ae3a8
-
9ae3a8
         ret = bdrv_write(bs, sector_num, buf, s->cluster_sectors);
9ae3a8
         if (ret < 0) {
9ae3a8
             goto fail;
9ae3a8
-- 
9ae3a8
1.7.1
9ae3a8