maple_tree: fix depth tracking in maple_state
authorLiam Howlett <liam.howlett@oracle.com>
Mon, 7 Nov 2022 16:38:35 +0000 (16:38 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 8 Nov 2022 23:57:25 +0000 (15:57 -0800)
commit9bbba5633488ee3e2903647c3484c4390ff39ea7
tree29d07e9e978c048e12df7e5357b989526b08afe4
parent1fdbed657a4726639c4f17841fd2a0fb646c746e
maple_tree: fix depth tracking in maple_state

It is possible to confuse the depth tracking in the maple state by
searching the same node for values.  Fix the depth tracking by moving
where the depth is incremented closer to where the node changes level.
Also change the initial depth setting when using the root node.

Link: https://lkml.kernel.org/r/20221107163814.866612-1-Liam.Howlett@oracle.com
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/maple_tree.c