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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Apr 2023 12:28:38 +0000 (14:28 +0200)
commitc51b9ef3f52161ee009af34555af7719fdcf74f1
tree37d2e1acf77f8c1b786b6bd2b66c9fb21ba8b0eb
parentbe100a8460e3fa44b0583513a909dcf1e096b3f1
maple_tree: make maple state reusable after mas_empty_area_rev()

commit fad8e4291da5e3243e086622df63cb952db444d8 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
lib/maple_tree.c