aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wilcox <mawilcox@microsoft.com>2017-11-09 20:15:14 -0500
committerMatthew Wilcox <mawilcox@microsoft.com>2018-02-06 15:07:20 -0500
commit490645d027c5925b30c88b9c7a663850a641d15d (patch)
treeb4a3f935b649555ad08d2f747cbd199d78922352
parentradix tree test suite: Remove ARRAY_SIZE (diff)
downloadlinux-dev-490645d027c5925b30c88b9c7a663850a641d15d.tar.xz
linux-dev-490645d027c5925b30c88b9c7a663850a641d15d.zip
idr test suite: Fix ida_test_random()
The test was checking the wrong errno; ida_get_new_above() returns EAGAIN, not ENOMEM on memory allocation failure. Double the number of threads to increase the chance that we actually exercise this path during the test suite (it was a bit sporadic before). Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
-rw-r--r--tools/testing/radix-tree/idr-test.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/radix-tree/idr-test.c b/tools/testing/radix-tree/idr-test.c
index 30cd0b296f1a..193450b29bf0 100644
--- a/tools/testing/radix-tree/idr-test.c
+++ b/tools/testing/radix-tree/idr-test.c
@@ -380,7 +380,7 @@ void ida_check_random(void)
do {
ida_pre_get(&ida, GFP_KERNEL);
err = ida_get_new_above(&ida, bit, &id);
- } while (err == -ENOMEM);
+ } while (err == -EAGAIN);
assert(!err);
assert(id == bit);
}
@@ -489,7 +489,7 @@ static void *ida_random_fn(void *arg)
void ida_thread_tests(void)
{
- pthread_t threads[10];
+ pthread_t threads[20];
int i;
for (i = 0; i < ARRAY_SIZE(threads); i++)