]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Remove BUG_ON() from mas_set_height()
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Thu, 1 Sep 2022 01:06:49 +0000 (21:06 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Tue, 13 Dec 2022 21:22:36 +0000 (16:22 -0500)
Use MT_WARN_ON() instead of MT_BUG_ON() as to avoid crashing the kernel.
In the unlikely even of a tree height of > 31, try to increase the
probability of the error being logged.

Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
lib/maple_tree.c

index ee083601dabe98f30de7df15a457dc706d6337fc..27f22ad1273123f168c9b4ca8feb259deab776df 100644 (file)
@@ -189,7 +189,7 @@ static void mas_set_height(struct ma_state *mas)
        unsigned int new_flags = mas->tree->ma_flags;
 
        new_flags &= ~MT_FLAGS_HEIGHT_MASK;
-       MT_BUG_ON(mas->tree, mas->depth > MAPLE_HEIGHT_MAX);
+       MT_WARN_ON(mas->tree, mas->depth > MAPLE_HEIGHT_MAX);
        new_flags |= mas->depth << MT_FLAGS_HEIGHT_OFFSET;
        mas->tree->ma_flags = new_flags;
 }