From: Max Reitz Date: Mon, 28 Oct 2019 16:18:40 +0000 (+0100) Subject: qcow2: Fix QCOW2_COMPRESSED_SECTOR_MASK X-Git-Tag: v4.2.0-rc0~1^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=24552feb6ae2f615b76c2b95394af43901f75046;p=thirdparty%2Fqemu.git qcow2: Fix QCOW2_COMPRESSED_SECTOR_MASK 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 Message-id: 20191028161841.1198-2-mreitz@redhat.com Reviewed-by: Alberto Garcia Signed-off-by: Max Reitz --- diff --git a/block/qcow2.h b/block/qcow2.h index 601c2e4c825..09421262325 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -83,7 +83,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 */