From: Sage Weil Date: Tue, 24 Apr 2018 22:11:15 +0000 (-0500) Subject: os/bluestore/bluefs_types: make block_mask 64-bit X-Git-Tag: v13.1.0~97^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F21629%2Fhead;p=ceph.git os/bluestore/bluefs_types: make block_mask 64-bit Since block_size is 32 bits, we return 0x00000000fffff000 (or similar). This breaks things if you get a file (e.g., bluefs metadata log file) over 4GB. Fixes: https://tracker.ceph.com/issues/23840 Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/bluefs_types.h b/src/os/bluestore/bluefs_types.h index 4634be503852..99c59c84285f 100644 --- a/src/os/bluestore/bluefs_types.h +++ b/src/os/bluestore/bluefs_types.h @@ -128,7 +128,7 @@ struct bluefs_super_t { block_size(4096) { } uint64_t block_mask() const { - return ~(block_size - 1); + return ~((uint64_t)block_size - 1); } void encode(bufferlist& bl) const;