From: Liam R. Howlett Date: Thu, 1 Sep 2022 01:10:02 +0000 (-0400) Subject: maple_tree: Remove BUG_ON() from mas_topiary_range() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=2553b44d5d06c82a2a52931d55fa8632f80f7ea8;p=users%2Fjedix%2Flinux-maple.git 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 --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 13116cd5c5b8..47e0540c9100 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -2311,7 +2311,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);