From: Liam R. Howlett Date: Thu, 1 Sep 2022 01:06:49 +0000 (-0400) Subject: maple_tree: Remove BUG_ON() from mas_set_height() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=eec9ab99640034fec08d600c283a3f8c1d7b0ae4;p=users%2Fjedix%2Flinux-maple.git maple_tree: Remove BUG_ON() from mas_set_height() 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 --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index ee083601dabe9..27f22ad127312 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -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; }