maple_tree: make maple state reusable after mas_empty_area_rev()
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Fri, 14 Apr 2023 14:57:26 +0000 (10:57 -0400)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 18 Apr 2023 21:22:13 +0000 (14:22 -0700)
commitfad8e4291da5e3243e086622df63cb952db444d8
treeec88f6559807bc93004df1d603a22c2b32eb61e7
parentfdea03e12aa2a44a7bb34144208be97fc25dfd90
maple_tree: make maple state reusable after mas_empty_area_rev()

Stop using maple state min/max for the range by passing through pointers
for those values.  This will allow the maple state to be reused without
resetting.

Also add some logic to fail out early on searching with invalid
arguments.

Link: https://lkml.kernel.org/r/20230414145728.4067069-1-Liam.Howlett@oracle.com
Fixes: 54a611b60590 ("Maple Tree: add new data structure")
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Reported-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/maple_tree.c