From: Kent Overstreet Date: Mon, 8 Mar 2021 00:04:16 +0000 (-0500) Subject: bcachefs: Don't call into journal reclaim when we're not supposed to X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=bcdb4b9732208fb8d3c634661a1b581437dcdd12;p=linux.git 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 Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/btree_update_leaf.c b/fs/bcachefs/btree_update_leaf.c index d99a78f8950dc..70cf18bcbcddd 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)