bcachefs: Fix a faulty assertion
authorKent Overstreet <kent.overstreet@gmail.com>
Fri, 22 Jan 2021 00:15:49 +0000 (19:15 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:51 +0000 (17:08 -0400)
If journal replay hasn't finished, the journal can't be empty - oops.

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

index 6f84a5dd06bc405cf6a89295ec401040db2a1449..ecc3629bcd4c8dcd7dcd9196b6e05a87ccaf99b5 100644 (file)
@@ -953,6 +953,7 @@ void bch2_fs_journal_stop(struct journal *j)
        journal_quiesce(j);
 
        BUG_ON(!bch2_journal_error(j) &&
+              test_bit(JOURNAL_REPLAY_DONE, &j->flags) &&
               (journal_entry_is_open(j) ||
                j->last_empty_seq + 1 != journal_cur_seq(j)));