]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Remove BUG_ON() from mas_topiary_range()
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Thu, 1 Sep 2022 01:10:02 +0000 (21:10 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Tue, 13 Dec 2022 21:22:36 +0000 (16:22 -0500)
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 <Liam.Howlett@oracle.com>
lib/maple_tree.c

index 27f22ad1273123f168c9b4ca8feb259deab776df..05feed59570c28df7f021c73678bf900319d65bf 100644 (file)
@@ -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);