render / rpms / qemu

Forked from rpms/qemu 5 months ago
Clone

Blame 0005-qcow2-Fix-QCOW2_COMPRESSED_SECTOR_MASK.patch

8e6758
From: Max Reitz <mreitz@redhat.com>
8e6758
Date: Mon, 28 Oct 2019 17:18:40 +0100
8e6758
Subject: [PATCH] qcow2: Fix QCOW2_COMPRESSED_SECTOR_MASK
8e6758
8e6758
Masks for L2 table entries should have 64 bit.
8e6758
8e6758
Fixes: b6c246942b14d3e0dec46a6c5868ed84e7dbea19
8e6758
Buglink: https://bugs.launchpad.net/qemu/+bug/1850000
8e6758
Cc: qemu-stable@nongnu.org
8e6758
Signed-off-by: Max Reitz <mreitz@redhat.com>
8e6758
---
8e6758
 block/qcow2.h | 2 +-
8e6758
 1 file changed, 1 insertion(+), 1 deletion(-)
8e6758
8e6758
diff --git a/block/qcow2.h b/block/qcow2.h
8e6758
index 567375e56c..45f9585c08 100644
8e6758
--- a/block/qcow2.h
8e6758
+++ b/block/qcow2.h
8e6758
@@ -77,7 +77,7 @@
8e6758
 
8e6758
 /* Defined in the qcow2 spec (compressed cluster descriptor) */
8e6758
 #define QCOW2_COMPRESSED_SECTOR_SIZE 512U
8e6758
-#define QCOW2_COMPRESSED_SECTOR_MASK (~(QCOW2_COMPRESSED_SECTOR_SIZE - 1))
8e6758
+#define QCOW2_COMPRESSED_SECTOR_MASK (~(QCOW2_COMPRESSED_SECTOR_SIZE - 1ULL))
8e6758
 
8e6758
 /* Must be at least 2 to cover COW */
8e6758
 #define MIN_L2_CACHE_SIZE 2 /* cache entries */