]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
qcow2: Fix QCOW2_COMPRESSED_SECTOR_MASK
authorMax Reitz <mreitz@redhat.com>
Mon, 28 Oct 2019 16:18:40 +0000 (17:18 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 11 Nov 2019 21:40:36 +0000 (15:40 -0600)
Masks for L2 table entries should have 64 bit.

Fixes: b6c246942b14d3e0dec46a6c5868ed84e7dbea19
Buglink: https://bugs.launchpad.net/qemu/+bug/1850000
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-id: 20191028161841.1198-2-mreitz@redhat.com
Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
(cherry picked from commit 24552feb6ae2f615b76c2b95394af43901f75046)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/qcow2.h

index fc1b0d3c1e1e3110e86f36f0dcd9ded63765eac2..359197f89fb9547d861d852cbf6801e50f488c2e 100644 (file)
@@ -77,7 +77,7 @@
 
 /* Defined in the qcow2 spec (compressed cluster descriptor) */
 #define QCOW2_COMPRESSED_SECTOR_SIZE 512U
-#define QCOW2_COMPRESSED_SECTOR_MASK (~(QCOW2_COMPRESSED_SECTOR_SIZE - 1))
+#define QCOW2_COMPRESSED_SECTOR_MASK (~(QCOW2_COMPRESSED_SECTOR_SIZE - 1ULL))
 
 /* Must be at least 2 to cover COW */
 #define MIN_L2_CACHE_SIZE 2 /* cache entries */