]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bcachefs: Add an assertion for trying to evict btree root
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 24 Mar 2024 23:52:03 +0000 (19:52 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Mon, 1 Apr 2024 00:36:11 +0000 (20:36 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_cache.c

index 562561a9a510e8ce55cdee26a9b064d4c07cf02d..8ff21b2e1463610e36b2de6b60f918340370b4f6 100644 (file)
@@ -1134,6 +1134,8 @@ void bch2_btree_node_evict(struct btree_trans *trans, const struct bkey_i *k)
        b = btree_cache_find(bc, k);
        if (!b)
                return;
+
+       BUG_ON(b == btree_node_root(trans->c, b));
 wait_on_io:
        /* not allowed to wait on io with btree locks held: */