summaryrefslogtreecommitdiff
path: root/fs/bcachefs/journal_reclaim.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-02-25 22:45:58 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:25 -0400
commit2975cd4701b71d5b28753861a9388bf67db26231 (patch)
tree5395ef785d36b60484ef7e6e6a198e2f38b41890 /fs/bcachefs/journal_reclaim.c
parenta0a07c59f5b4646b9371a1c119feeb6ee52b0012 (diff)
downloadlwn-2975cd4701b71d5b28753861a9388bf67db26231.tar.gz
lwn-2975cd4701b71d5b28753861a9388bf67db26231.zip
bcachefs: Don't spin in journal reclaim
If we're not able to flush anything, we shouldn't keep looping. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
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 3cc980b07285..449f4fbfa326 100644
--- a/fs/bcachefs/journal_reclaim.c
+++ b/fs/bcachefs/journal_reclaim.c
@@ -661,7 +661,7 @@ static int __bch2_journal_reclaim(struct journal *j, bool direct)
if (nr_flushed)
wake_up(&j->reclaim_wait);
- } while ((min_nr || min_key_cache) && !direct);
+ } while ((min_nr || min_key_cache) && nr_flushed && !direct);
memalloc_noreclaim_restore(flags);