From: Kent Overstreet Date: Sun, 6 Dec 2020 21:29:13 +0000 (-0500) Subject: bcachefs: Prevent journal reclaim from spinning X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b18df768ebf71196c3620d1e5f23f064c1ba1485;p=linux.git bcachefs: Prevent journal reclaim from spinning Without checking if we actually flushed anything, journal reclaim could still go into an infinite loop while trying ot shut down. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/journal_reclaim.c b/fs/bcachefs/journal_reclaim.c index 5ab147e94167c..e8fd11abe4c3a 100644 --- a/fs/bcachefs/journal_reclaim.c +++ b/fs/bcachefs/journal_reclaim.c @@ -610,7 +610,7 @@ static int __bch2_journal_reclaim(struct journal *j, bool direct) else j->nr_background_reclaim += nr_flushed; trace_journal_reclaim_finish(c, nr_flushed); - } while (min_nr); + } while (min_nr && nr_flushed); memalloc_noreclaim_restore(flags);