[11/34] maple_tree: Use MAS_BUG_ON() in mas_set_height()

Message ID 20230425140955.3834476-12-Liam.Howlett@oracle.com
State New
Headers
Series Maple tree mas_{next,prev}_range() and cleanup |

Commit Message

Liam R. Howlett April 25, 2023, 2:09 p.m. UTC
  Use MAS_BUG_ON() instead of MT_BUG_ON() to get the maple state
information.  In the unlikely even of a tree height of > 31, try to increase
the probability of useful information being logged.

Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
---
 lib/maple_tree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Petr Tesařík April 28, 2023, 10:10 a.m. UTC | #1
On Tue, 25 Apr 2023 10:09:32 -0400
"Liam R. Howlett" <Liam.Howlett@oracle.com> wrote:

> Use MAS_BUG_ON() instead of MT_BUG_ON() to get the maple state
> information.  In the unlikely even of a tree height of > 31, try to increase
                                ^^^^
Again, *event*. Consider buying a new keyboard if your 'T' is broken. ;-)

Petr T
  
Liam R. Howlett May 3, 2023, 7:33 p.m. UTC | #2
* Petr Tesařík <petr@tesarici.cz> [230428 06:10]:
> On Tue, 25 Apr 2023 10:09:32 -0400
> "Liam R. Howlett" <Liam.Howlett@oracle.com> wrote:
> 
> > Use MAS_BUG_ON() instead of MT_BUG_ON() to get the maple state
> > information.  In the unlikely even of a tree height of > 31, try to increase
>                                 ^^^^
> Again, *event*. Consider buying a new keyboard if your 'T' is broken. ;-)

hanks.  I will fix This in v2. :)

> 
> Petr T
  

Patch

diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index 441592be039a2..f1ce3852712db 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -194,7 +194,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);
+	MAS_BUG_ON(mas, mas->depth > MAPLE_HEIGHT_MAX);
 	new_flags |= mas->depth << MT_FLAGS_HEIGHT_OFFSET;
 	mas->tree->ma_flags = new_flags;
 }