diff --git a/fs/bcachefs/journal.c b/fs/bcachefs/journal.c index 759a04346cde..0cd868c8248b 100644 --- a/fs/bcachefs/journal.c +++ b/fs/bcachefs/journal.c @@ -552,16 +552,13 @@ int bch2_journal_flush_seq_async(struct journal *j, u64 seq, struct journal_buf *buf; int ret = 0; - if (seq <= j->err_seq) - return -EIO; - if (seq <= j->seq_ondisk) return 1; spin_lock(&j->lock); /* Recheck under lock: */ - if (seq <= j->err_seq) { + if (j->err_seq && seq >= j->err_seq) { ret = -EIO; goto out; }