]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
bcachefs: Delete incorrect BTREE_ID_NR assertion
authorKent Overstreet <kent.overstreet@linux.dev>
Thu, 6 Jun 2024 18:02:11 +0000 (14:02 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Mon, 10 Jun 2024 17:17:16 +0000 (13:17 -0400)
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: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_iter.c

index d3bcb4e4e23060417abfce011554c1f90341509e..53b63be537e559eb1ad46175cb208fc9c6d76aef 100644 (file)
@@ -221,11 +221,8 @@ static void bch2_btree_path_verify(struct btree_trans *trans,
                                   struct btree_path *path)
 {
        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) {
                        BUG_ON(!path->cached &&
                               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)
 {
        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_is_extents) &&