summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2020-10-25 01:08:28 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2020-11-05 12:45:14 -0500
commit5eb2b7cacb5d70e26feff672bd5f435863a36ebf (patch)
tree1e58f81b87a0f2205dfc81c2b6ecd6e0474c2179
parent4bfdd83655a87ecdafa90db52566268d6a6a68de (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>
-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 b8b719902c63..c2cafd3892a4 100644
--- a/fs/bcachefs/journal.c
+++ b/fs/bcachefs/journal.c
@@ -980,9 +980,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);