From 2975cd4701b71d5b28753861a9388bf67db26231 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Fri, 25 Feb 2022 22:45:58 -0500 Subject: [PATCH] bcachefs: Don't spin in journal reclaim If we're not able to flush anything, we shouldn't keep looping. Signed-off-by: Kent Overstreet --- fs/bcachefs/journal_reclaim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/bcachefs/journal_reclaim.c b/fs/bcachefs/journal_reclaim.c index 3cc980b072855..449f4fbfa326d 100644 --- a/fs/bcachefs/journal_reclaim.c +++ b/fs/bcachefs/journal_reclaim.c @@ -661,7 +661,7 @@ static int __bch2_journal_reclaim(struct journal *j, bool direct) if (nr_flushed) wake_up(&j->reclaim_wait); - } while ((min_nr || min_key_cache) && !direct); + } while ((min_nr || min_key_cache) && nr_flushed && !direct); memalloc_noreclaim_restore(flags); -- 2.30.2