diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-12-06 16:29:13 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2020-12-16 15:29:10 -0500 |
commit | 4ee8899043a0aea68303e827be44c3ff93e59320 (patch) | |
tree | 58d12ecb1e143534f03931d9933d91559dc7475d | |
parent | b6d98c4d2378cee8c7d03b92d7e1ce6e73afb7c9 (diff) |
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>
-rw-r--r-- | fs/bcachefs/journal_reclaim.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/journal_reclaim.c b/fs/bcachefs/journal_reclaim.c index 2319a2b6528e..b77d4e7f42d6 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); |