From: Kent Overstreet Date: Sat, 26 Feb 2022 03:45:58 +0000 (-0500) Subject: bcachefs: Don't spin in journal reclaim X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=2975cd4701b71d5b28753861a9388bf67db26231;p=linux.git 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 --- 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);