Commit 531b69e9 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet
Browse files

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: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent 61d876c2
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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) {