Commit fa845c73 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Fix bch2_dev_btree_bitmap_marked_sectors() shift

Fixes: 27c15ed2 bcachefs: bch_member.btree_allocated_bitmap
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 79055f50
......@@ -463,8 +463,8 @@ static void __bch2_dev_btree_bitmap_mark(struct bch_sb_field_members_v2 *mi, uns
m->btree_bitmap_shift += resize;
}
for (unsigned bit = sectors >> m->btree_bitmap_shift;
bit << m->btree_bitmap_shift < end;
for (unsigned bit = start >> m->btree_bitmap_shift;
(u64) bit << m->btree_bitmap_shift < end;
bit++)
bitmap |= BIT_ULL(bit);
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment