bcachefs: Fix journal_flush_done()
authorKent Overstreet <kent.overstreet@gmail.com>
Sat, 26 Feb 2022 03:14:35 +0000 (22:14 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:25 +0000 (17:09 -0400)
journal_flush_done() was overwriting did_work, thus occasionally
returning false when it did do work and occasional assertions in the
shutdown sequence because we didn't completely flush the key cache.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/journal_reclaim.c

index 2d5382a83003bc95a745ee5d02a6b52a1366c5f1..3cc980b0728551ef68d2e77639ee31776bf2836e 100644 (file)
@@ -759,7 +759,8 @@ static int journal_flush_done(struct journal *j, u64 seq_to_flush,
 
        mutex_lock(&j->reclaim_lock);
 
-       *did_work = journal_flush_pins(j, seq_to_flush, 0, 0) != 0;
+       if (journal_flush_pins(j, seq_to_flush, 0, 0))
+               *did_work = true;
 
        spin_lock(&j->lock);
        /*