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 <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2020-12-06 16:29:13 -05:00 committed by Kent Overstreet
parent f51e84fe24
commit b18df768eb
1 changed files with 1 additions and 1 deletions

View File

@ -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);