From: Kent Overstreet Date: Sun, 24 Mar 2024 23:52:03 +0000 (-0400) Subject: bcachefs: Add an assertion for trying to evict btree root X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=aa6e130e3c2965a5c26a4033ff63b5dc9549bd76;p=linux.git bcachefs: Add an assertion for trying to evict btree root Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/btree_cache.c b/fs/bcachefs/btree_cache.c index 562561a9a510e..8ff21b2e14636 100644 --- a/fs/bcachefs/btree_cache.c +++ b/fs/bcachefs/btree_cache.c @@ -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: */