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 <kent.overstreet@gmail.com>
This commit is contained in:
Kent Overstreet 2021-11-13 17:53:55 -05:00 committed by Kent Overstreet
parent 61d876c25d
commit 531b69e9af

View file

@ -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) {