From fbbda6f2968463c507e8fc39a5c66462f558feba Mon Sep 17 00:00:00 2001 From: "Liam R. Howlett" Date: Wed, 31 Aug 2022 21:10:02 -0400 Subject: [PATCH] maple_tree: Remove BUG_ON() from mas_topiary_range() In the even of trying to remove data from a leaf node by use of mas_topiary_range(), simply log the issue and return. This will be quickly followed by a crash but logging and returning will increase the probability of meaningful data. Signed-off-by: Liam R. Howlett --- lib/maple_tree.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 27f22ad12731..05feed59570c 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -2359,7 +2359,9 @@ static inline void mas_topiary_range(struct ma_state *mas, void __rcu **slots; unsigned char offset; - MT_BUG_ON(mas->tree, mte_is_leaf(mas->node)); + if (MT_WARN_ON(mas->tree, mte_is_leaf(mas->node))) + return; + slots = ma_slots(mas_mn(mas), mte_node_type(mas->node)); for (offset = start; offset <= end; offset++) { struct maple_enode *enode = mas_slot_locked(mas, slots, offset); -- 2.49.0