From 5b29dd996a3e5f0427a4f478c51ae8fa26ee1764 Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Thu, 1 Sep 2022 17:33:43 -0400 Subject: [PATCH] maple_tree: Change RCU checks to WARN_ON() instead of BUG_ON() If RCU is enabled and the tree isn't locked, just warn the user and avoid crashing the kernel. Signed-off-by: Liam R. Howlett --- include/linux/maple_tree.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index 71de6ef474e4..ff6f2e1f1355 100644 --- a/include/linux/maple_tree.h +++ b/include/linux/maple_tree.h @@ -621,7 +621,7 @@ static inline void mt_clear_in_rcu(struct maple_tree *mt) return; if (mt_external_lock(mt)) { - BUG_ON(!mt_lock_is_held(mt)); + WARN_ON(!mt_lock_is_held(mt)); mt->ma_flags &= ~MT_FLAGS_USE_RCU; } else { mtree_lock(mt); @@ -640,7 +640,7 @@ static inline void mt_set_in_rcu(struct maple_tree *mt) return; if (mt_external_lock(mt)) { - BUG_ON(!mt_lock_is_held(mt)); + WARN_ON(!mt_lock_is_held(mt)); mt->ma_flags |= MT_FLAGS_USE_RCU; } else { mtree_lock(mt); -- 2.49.0