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: v12.2.6~162^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F21740%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 (cherry picked from commit 55dd28a9dee08a028c6a8db82a8be77b3af88e44) --- diff --git a/src/os/bluestore/bluefs_types.h b/src/os/bluestore/bluefs_types.h index b5bf775cb7b3..6aec1a31a8b6 100644 --- a/src/os/bluestore/bluefs_types.h +++ b/src/os/bluestore/bluefs_types.h @@ -127,7 +127,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;