From c5bb1690346167888d3b2834b4b11d9cfa682583 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Wed, 2 Dec 2020 15:33:12 -0500 Subject: [PATCH] bcachefs: Fix journal_flush_seq() The error check was inverted - leading fsyncs to get stuck and hang, oops. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet --- fs/bcachefs/journal.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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; }