sst-linux/tools/testing/radix-tree
Matthew Wilcox (Oracle) 4a3e0d51c3 XArray: Do not return sibling entries from xa_load()
commit cbc02854331edc6dc22d8b77b6e22e38ebc7dd51 upstream.

It is possible for xa_load() to observe a sibling entry pointing to
another sibling entry.  An example:

Thread A:		Thread B:
			xa_store_range(xa, entry, 188, 191, gfp);
xa_load(xa, 191);
entry = xa_entry(xa, node, 63);
[entry is a sibling of 188]
			xa_store_range(xa, entry, 184, 191, gfp);
if (xa_is_sibling(entry))
offset = xa_to_sibling(entry);
entry = xa_entry(xas->xa, node, offset);
[entry is now a sibling of 184]

It is sufficient to go around this loop until we hit a non-sibling entry.
Sibling entries always point earlier in the node, so we are guaranteed
to terminate this search.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Fixes: 6b24ca4a1a ("mm: Use multi-index entries in the page cache")
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-09-13 09:43:00 +02:00
..
generated maple_tree: reorganize testing to restore module testing 2022-11-08 15:57:22 -08:00
linux maple_tree: add __init and __exit to test module 2023-08-03 10:23:55 +02:00
trace/events Maple Tree: add new data structure 2022-09-26 19:46:13 -07:00
.gitignore maple_tree: reorganize testing to restore module testing 2022-11-08 15:57:22 -08:00
benchmark.c
bitmap.c
idr-test.c
iteration_check_2.c
iteration_check.c
linux.c maple_tree: reorganize testing to restore module testing 2022-11-08 15:57:22 -08:00
main.c
Makefile maple_tree: reorganize testing to restore module testing 2022-11-08 15:57:22 -08:00
maple.c maple_tree: add __init and __exit to test module 2023-08-03 10:23:55 +02:00
multiorder.c XArray: Do not return sibling entries from xa_load() 2023-09-13 09:43:00 +02:00
regression1.c radix tree test suite: fix incorrect allocation size for pthreads 2023-08-16 18:27:22 +02:00
regression2.c
regression3.c
regression4.c
regression.h
tag_check.c
test.c
test.h
xarray.c