diff mbox series

[21/34] maple_tree: mas_start() reset depth on dead node

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

Commit Message

Liam R. Howlett April 25, 2023, 2:09 p.m. UTC
When a dead node is detected, the depth has already been set to 1 so
reset it to 0.

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

Comments

Peng Zhang April 28, 2023, 2:45 a.m. UTC | #1
在 2023/4/25 22:09, Liam R. Howlett 写道:
> When a dead node is detected, the depth has already been set to 1 so
> reset it to 0.
> 
> Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Reviewed-by: Peng Zhang <zhangpeng.00@bytedance.com>
> ---
>   lib/maple_tree.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/maple_tree.c b/lib/maple_tree.c
> index 35c6e12ca9482..1542274dc2b7f 100644
> --- a/lib/maple_tree.c
> +++ b/lib/maple_tree.c
> @@ -1397,9 +1397,9 @@ static inline struct maple_enode *mas_start(struct ma_state *mas)
>   
>   		mas->min = 0;
>   		mas->max = ULONG_MAX;
> -		mas->depth = 0;
>   
>   retry:
> +		mas->depth = 0;
>   		root = mas_root(mas);
>   		/* Tree with nodes */
>   		if (likely(xa_is_node(root))) {
diff mbox series

Patch

diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index 35c6e12ca9482..1542274dc2b7f 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -1397,9 +1397,9 @@  static inline struct maple_enode *mas_start(struct ma_state *mas)
 
 		mas->min = 0;
 		mas->max = ULONG_MAX;
-		mas->depth = 0;
 
 retry:
+		mas->depth = 0;
 		root = mas_root(mas);
 		/* Tree with nodes */
 		if (likely(xa_is_node(root))) {