bcachefs: Assert that we're not trying to flush journal seq in the future
authorKent Overstreet <kent.overstreet@gmail.com>
Wed, 10 Feb 2021 18:39:48 +0000 (13:39 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:53 +0000 (17:08 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/journal.c

index b33d985fa020d542b17c5585d5faea7ef9ed42d3..c2b1eef6265a1045e812f46333afe8cbe1e360c2 100644 (file)
@@ -574,6 +574,8 @@ int bch2_journal_flush_seq_async(struct journal *j, u64 seq,
 
        spin_lock(&j->lock);
 
+       BUG_ON(seq > journal_cur_seq(j));
+
        /* Recheck under lock: */
        if (j->err_seq && seq >= j->err_seq) {
                ret = -EIO;