From: Liam R. Howlett Date: Thu, 1 Sep 2022 21:33:43 +0000 (-0400) Subject: maple_tree: Change RCU checks to WARN_ON() instead of BUG_ON() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=9ec93f67aa0ffd6f3743c13afa91831577b1879d;p=users%2Fjedix%2Flinux-maple.git 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 --- diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h index 03e383d5982a..d3f601c6d49a 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);