]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
bcachefs: Unwritten journal buffers are always dirty
authorKent Overstreet <kent.overstreet@linux.dev>
Tue, 7 Nov 2023 23:08:38 +0000 (18:08 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Mon, 1 Jan 2024 16:47:41 +0000 (11:47 -0500)
Ensure that journal bufs that haven't been written can't be reclaimed
from the journal pin fifo, and can thus have new pins taken.

Prep work for changing the btree write buffer to pull keys from the
journal directly.

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

index bd33a7c9634c4300473e0e12fdddcf34adb702bd..dc415e0ec4930a74eda4c934c32c92d9e8e22780 100644 (file)
@@ -303,6 +303,7 @@ void bch2_journal_reclaim_fast(struct journal *j)
         * all btree nodes got written out
         */
        while (!fifo_empty(&j->pin) &&
+              j->pin.front <= j->seq_ondisk &&
               !atomic_read(&fifo_peek_front(&j->pin).count)) {
                j->pin.front++;
                popped = true;