Commit 04f635ed authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Delete incorrect BTREE_ID_NR assertion

for forwards compat we now explicitly allow mounting and using
filesystems with unknown btrees, and we have to walk them for fsck.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 1c8cc24e
...@@ -221,11 +221,8 @@ static void bch2_btree_path_verify(struct btree_trans *trans, ...@@ -221,11 +221,8 @@ static void bch2_btree_path_verify(struct btree_trans *trans,
struct btree_path *path) struct btree_path *path)
{ {
struct bch_fs *c = trans->c; struct bch_fs *c = trans->c;
unsigned i;
EBUG_ON(path->btree_id >= BTREE_ID_NR);
for (i = 0; i < (!path->cached ? BTREE_MAX_DEPTH : 1); i++) { for (unsigned i = 0; i < (!path->cached ? BTREE_MAX_DEPTH : 1); i++) {
if (!path->l[i].b) { if (!path->l[i].b) {
BUG_ON(!path->cached && BUG_ON(!path->cached &&
bch2_btree_id_root(c, path->btree_id)->b->c.level > i); bch2_btree_id_root(c, path->btree_id)->b->c.level > i);
...@@ -251,8 +248,6 @@ static void bch2_btree_iter_verify(struct btree_iter *iter) ...@@ -251,8 +248,6 @@ static void bch2_btree_iter_verify(struct btree_iter *iter)
{ {
struct btree_trans *trans = iter->trans; struct btree_trans *trans = iter->trans;
BUG_ON(iter->btree_id >= BTREE_ID_NR);
BUG_ON(!!(iter->flags & BTREE_ITER_cached) != btree_iter_path(trans, iter)->cached); BUG_ON(!!(iter->flags & BTREE_ITER_cached) != btree_iter_path(trans, iter)->cached);
BUG_ON((iter->flags & BTREE_ITER_is_extents) && BUG_ON((iter->flags & BTREE_ITER_is_extents) &&
......
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