From: Kent Overstreet Date: Sat, 13 Nov 2021 22:53:55 +0000 (-0500) Subject: bcachefs: Convert journal BUG_ON() to a warning X-Git-Tag: v6.7-rc1~201^2~1292 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=531b69e9afed954156b193264daf32c067454952;p=thirdparty%2Fkernel%2Flinux.git bcachefs: Convert journal BUG_ON() to a warning It's definitely indicative of a bug if we request to flush a journal sequence number that hasn't happened yet, but it's more useful if we warn and print out the relevant sequence numbers instead of just dying. Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/journal.c b/fs/bcachefs/journal.c index 1abd1ac560e6d..1ee012d94b4ae 100644 --- a/fs/bcachefs/journal.c +++ b/fs/bcachefs/journal.c @@ -550,7 +550,10 @@ int bch2_journal_flush_seq_async(struct journal *j, u64 seq, spin_lock(&j->lock); - BUG_ON(seq > journal_cur_seq(j)); + if (WARN_ONCE(seq > journal_cur_seq(j), + "requested to flush journal seq %llu, but currently at %llu", + seq, journal_cur_seq(j))) + goto out; /* Recheck under lock: */ if (j->err_seq && seq >= j->err_seq) {