mirror of
https://github.com/torvalds/linux.git
synced 2025-11-03 18:20:25 +02:00
bcachefs: Add new assertions for shutdown path
We've been seeing assertions pop that indicate the btree node cache or key cache have dirty items when we just did a clean shutdown. Add some more assertions so we can catch this when we're dirtying items. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
07f293c863
commit
30a8278a1e
2 changed files with 4 additions and 1 deletions
|
|
@ -780,6 +780,7 @@ bool bch2_btree_insert_key_cached(struct btree_trans *trans,
|
|||
ck->valid = true;
|
||||
|
||||
if (!test_bit(BKEY_CACHED_DIRTY, &ck->flags)) {
|
||||
EBUG_ON(test_bit(BCH_FS_CLEAN_SHUTDOWN, &c->flags));
|
||||
set_bit(BKEY_CACHED_DIRTY, &ck->flags);
|
||||
atomic_long_inc(&c->btree_key_cache.nr_dirty);
|
||||
|
||||
|
|
|
|||
|
|
@ -272,8 +272,10 @@ inline void bch2_btree_insert_key_leaf(struct btree_trans *trans,
|
|||
|
||||
bch2_btree_add_journal_pin(c, b, journal_seq);
|
||||
|
||||
if (unlikely(!btree_node_dirty(b)))
|
||||
if (unlikely(!btree_node_dirty(b))) {
|
||||
EBUG_ON(test_bit(BCH_FS_CLEAN_SHUTDOWN, &c->flags));
|
||||
set_btree_node_dirty_acct(c, b);
|
||||
}
|
||||
|
||||
live_u64s_added = (int) b->nr.live_u64s - old_live_u64s;
|
||||
u64s_added = (int) bset_u64s(t) - old_u64s;
|
||||
|
|
|
|||
Loading…
Reference in a new issue