cryptospore / rpms / qemu-kvm

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