diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-04-17 01:16:45 +0200 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-04-17 23:29:53 +0200 |
commit | fa845c73497f5e9d2f6f1cf48c3aad05c2fdacb8 (patch) | |
tree | 14973fadcb85d2f92813a1864b72787cde2fc000 /fs/bcachefs/sb-members.h | |
parent | bcachefs: make sure to release last journal pin in replay (diff) | |
download | linux-fa845c73497f5e9d2f6f1cf48c3aad05c2fdacb8.tar.xz linux-fa845c73497f5e9d2f6f1cf48c3aad05c2fdacb8.zip |
bcachefs: Fix bch2_dev_btree_bitmap_marked_sectors() shift
Fixes: 27c15ed297cb bcachefs: bch_member.btree_allocated_bitmap
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/sb-members.h')
-rw-r--r-- | fs/bcachefs/sb-members.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/bcachefs/sb-members.h b/fs/bcachefs/sb-members.h index b27c3e4467cf..5efa64eca5f8 100644 --- a/fs/bcachefs/sb-members.h +++ b/fs/bcachefs/sb-members.h @@ -235,11 +235,11 @@ static inline bool bch2_dev_btree_bitmap_marked_sectors(struct bch_dev *ca, u64 { u64 end = start + sectors; - if (end > 64 << ca->mi.btree_bitmap_shift) + if (end > 64ULL << ca->mi.btree_bitmap_shift) return false; - for (unsigned bit = sectors >> ca->mi.btree_bitmap_shift; - bit << ca->mi.btree_bitmap_shift < end; + for (unsigned bit = start >> ca->mi.btree_bitmap_shift; + (u64) bit << ca->mi.btree_bitmap_shift < end; bit++) if (!(ca->mi.btree_allocated_bitmap & BIT_ULL(bit))) return false; |