diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-04-17 02:33:51 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-05-09 00:29:20 +0300 |
commit | 60f2b1bcf519416dbffee219132aa949d0c39d0e (patch) | |
tree | e3daafbeeb6b576182e5716ffe2b6fce77a04508 | |
parent | 427e1bb8381899084fc316cce92dbc7508d9353b (diff) | |
download | linux-60f2b1bcf519416dbffee219132aa949d0c39d0e.tar.xz |
bcachefs: Add asserts to bch2_dev_btree_bitmap_marked_sectors()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r-- | fs/bcachefs/sb-members.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/bcachefs/sb-members.c b/fs/bcachefs/sb-members.c index 80bf09cfc021..50dc9f937c45 100644 --- a/fs/bcachefs/sb-members.c +++ b/fs/bcachefs/sb-members.c @@ -415,6 +415,9 @@ static void __bch2_dev_btree_bitmap_mark(struct bch_sb_field_members_v2 *mi, uns m->btree_bitmap_shift += resize; } + BUG_ON(m->btree_bitmap_shift > 57); + BUG_ON(end > 64ULL << m->btree_bitmap_shift); + for (unsigned bit = start >> m->btree_bitmap_shift; (u64) bit << m->btree_bitmap_shift < end; bit++) |