summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/journal_reclaim.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2020-12-06 16:29:13 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:49 -0400
commitb18df768ebf71196c3620d1e5f23f064c1ba1485 (patch)
tree094ee9f6ba69e11a9015290faf6b7365b4969c70 /fs/bcachefs/journal_reclaim.c
parentf51e84fe24d8d170bfbba626e76ee08b1ab7b283 (diff)
downloadlinux-b18df768ebf71196c3620d1e5f23f064c1ba1485.tar.gz
linux-b18df768ebf71196c3620d1e5f23f064c1ba1485.tar.bz2
linux-b18df768ebf71196c3620d1e5f23f064c1ba1485.zip
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>
Diffstat (limited to 'fs/bcachefs/journal_reclaim.c')
-rw-r--r--fs/bcachefs/journal_reclaim.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/journal_reclaim.c b/fs/bcachefs/journal_reclaim.c
index 5ab147e94167..e8fd11abe4c3 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);