Commit b18df768 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

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: default avatarKent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent f51e84fe
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment