acrn-kernel/tools/testing/radix-tree
Matthew Wilcox (Oracle) 4a3e0d51c3 XArray: Do not return sibling entries from xa_load()
commit cbc0285433 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
linux maple_tree: add __init and __exit to test module 2023-08-03 10:23:55 +02:00
trace/events
.gitignore
Makefile
benchmark.c
bitmap.c
idr-test.c
iteration_check.c
iteration_check_2.c
linux.c
main.c
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
regression.h
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
tag_check.c
test.c
test.h
xarray.c