]> git.baikalelectronics.ru Git - kernel.git/commit
maple_tree: fix mas_empty_area() search
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Fri, 14 Apr 2023 14:57:27 +0000 (10:57 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Apr 2023 12:28:39 +0000 (14:28 +0200)
commit20015c538af37927583469c8ce33f14b8828af59
treee5b5d394a967761c32071d2bf08be4300b785d31
parent48836e9339bb8008454d40961ecb25b330d4c72f
maple_tree: fix mas_empty_area() search

commit 06e8fd999334bcd76b4d72d7b9206d4aea89764e upstream.

The internal function of mas_awalk() was incorrectly skipping the last
entry in a node, which could potentially be NULL.  This is only a problem
for the left-most node in the tree - otherwise that NULL would not exist.

Fix mas_awalk() by using the metadata to obtain the end of the node for
the loop and the logical pivot as apposed to the raw pivot value.

Link: https://lkml.kernel.org/r/20230414145728.4067069-2-Liam.Howlett@oracle.com
Fixes: 6b5ffa9b4f4f ("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