diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-03-07 19:04:16 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2021-04-27 12:22:45 -0400 |
commit | 644936a234db0cc44250c5ac835c8bac58cb2736 (patch) | |
tree | fe58f6217f2b4922345563534df8fb4154249fe6 | |
parent | 67c5925986cd792f07a5e71ec11dd63433ecd015 (diff) |
bcachefs: Don't call into journal reclaim when we're not supposed to
This was causing a deadlock when btree_update_nodes_writtes() invokes
journal reclaim because of the btree cache being too dirty.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r-- | fs/bcachefs/btree_update_leaf.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/btree_update_leaf.c b/fs/bcachefs/btree_update_leaf.c index e18756b38fc2..53ea91b32fd5 100644 --- a/fs/bcachefs/btree_update_leaf.c +++ b/fs/bcachefs/btree_update_leaf.c @@ -284,7 +284,8 @@ btree_key_can_insert_cached(struct btree_trans *trans, BUG_ON(iter->level); if (!test_bit(BKEY_CACHED_DIRTY, &ck->flags) && - bch2_btree_key_cache_must_wait(trans->c)) + bch2_btree_key_cache_must_wait(trans->c) && + !(trans->flags & BTREE_INSERT_JOURNAL_RECLAIM)) return BTREE_INSERT_NEED_JOURNAL_RECLAIM; if (u64s <= ck->u64s) |