Skip to contentSkip to conversation

qcow2: Remove wrong metadata overlap check

PATCH Applied Max Reitz 2 participants 2 messages Oct 9, 2013 Block layer

lore
Share & tools
lore

Max Reitz

author
#0 lore raw

PATCH 1/1 qcow2: Remove wrong metadata overlap check

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.

---
 block/qcow2.c | 8 --------
 1 file changed, 8 deletions(-)
block/qcow2.c +0 -8
index d59ecbd..dc0b60e 100644
@@ -1738,14 +1738,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;
Signature · 1 line
1.8.3.1
Applied
#1 lore raw

Am 09.10.2013 um 14:41 hat Max Reitz geschrieben:

Quoted 6 lines

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.

Thanks, applied to the block branch.

Kevin