aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/radix-tree/main.c
diff options
context:
space:
mode:
authorMatthew Wilcox <willy@infradead.org>2018-12-06 08:19:13 -0500
committerMatthew Wilcox <willy@infradead.org>2018-12-06 08:26:16 -0500
commiteff3860bbfedbac6edac57fb0d7f3a60e860c1c3 (patch)
tree99b3f3e6321a16cfba84319c4a94a1aa653e68d9 /tools/testing/radix-tree/main.c
parentMerge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi (diff)
downloadlinux-dev-eff3860bbfedbac6edac57fb0d7f3a60e860c1c3.tar.xz
linux-dev-eff3860bbfedbac6edac57fb0d7f3a60e860c1c3.zip
radix tree: Don't return retry entries from lookup
Commit 66ee620f06f9 ("idr: Permit any valid kernel pointer to be stored") changed the radix tree lookup so that it stops when reaching the bottom of the tree. However, the condition was added in the wrong place, making it possible to return retry entries to the caller. Reorder the tests to check for the retry entry before checking whether we're at the bottom of the tree. The retry entry should never be found in the tree root, so it's safe to defer the check until the end of the loop. Add a regression test to the test-suite to be sure this doesn't come back. Fixes: 66ee620f06f9 ("idr: Permit any valid kernel pointer to be stored") Reported-by: Greg Kurz <groug@kaod.org> Signed-off-by: Matthew Wilcox <willy@infradead.org>
Diffstat (limited to 'tools/testing/radix-tree/main.c')
-rw-r--r--tools/testing/radix-tree/main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/radix-tree/main.c b/tools/testing/radix-tree/main.c
index 77a44c54998f..7a22d6e3732e 100644
--- a/tools/testing/radix-tree/main.c
+++ b/tools/testing/radix-tree/main.c
@@ -308,6 +308,7 @@ int main(int argc, char **argv)
regression1_test();
regression2_test();
regression3_test();
+ regression4_test();
iteration_test(0, 10 + 90 * long_run);
iteration_test(7, 10 + 90 * long_run);
single_thread_tests(long_run);