aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2020-10-25 01:08:28 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:45 -0400
commit8be901d5d4a266e6838cdb6781084a02d2b37ace (patch)
tree2d1b2048c6a81e5a61a0cda0ba2cb61aedfc6279 /fs
parent33114c2d897405ec338df979d1bf1d3319f92938 (diff)
bcachefs: Always write a journal entry when stopping journal
This is to fix a (harmless) bug where the read clock hand in the superblock doesn't match the journal. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs')
-rw-r--r--fs/bcachefs/journal.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/bcachefs/journal.c b/fs/bcachefs/journal.c
index d1e4a8162ddd..1f7f3b96bd87 100644
--- a/fs/bcachefs/journal.c
+++ b/fs/bcachefs/journal.c
@@ -979,9 +979,11 @@ void bch2_fs_journal_stop(struct journal *j)
wait_event(j->wait, journal_entry_close(j));
- /* do we need to write another journal entry? */
- if (test_bit(JOURNAL_NOT_EMPTY, &j->flags))
- bch2_journal_meta(j);
+ /*
+ * Always write a new journal entry, to make sure the clock hands are up
+ * to date (and match the superblock)
+ */
+ bch2_journal_meta(j);
journal_quiesce(j);