From: Kent Overstreet Date: Thu, 9 Feb 2023 20:49:25 +0000 (-0500) Subject: bcachefs: Switch a BUG_ON() to a panic() X-Git-Tag: io_uring-6.7-2023-11-10~119^2~569 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=434b1c75a4e79ee63cd58225567f752311cf3cd0;p=linux-block.git bcachefs: Switch a BUG_ON() to a panic() This assert is popping - rarely - in the CI, this will help us track it down from the logs. Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/btree_iter.c b/fs/bcachefs/btree_iter.c index 3d138ae19469..7bb7b5ffe001 100644 --- a/fs/bcachefs/btree_iter.c +++ b/fs/bcachefs/btree_iter.c @@ -1174,7 +1174,10 @@ int bch2_btree_path_traverse_one(struct btree_trans *trans, path->uptodate = BTREE_ITER_UPTODATE; out: - BUG_ON(bch2_err_matches(ret, BCH_ERR_transaction_restart) != !!trans->restarted); + if (bch2_err_matches(ret, BCH_ERR_transaction_restart) != !!trans->restarted) + panic("ret %s (%i) trans->restarted %s (%i)\n", + bch2_err_str(ret), ret, + bch2_err_str(trans->restarted), trans->restarted); bch2_btree_path_verify(trans, path); return ret; }