idr test suite: Fix ida_test_random()

"Linux Kernel Mailing List" <[email protected]>
Newsgroups gmane.linux.kernel.commits.head
Message-ID <[email protected]>
Web:        https://git.kernel.org/torvalds/c/490645d027c5925b30c88b9c7a663850a641d15d
Commit:     490645d027c5925b30c88b9c7a663850a641d15d
Parent:     051803c0d01f4d8a197ecc08bfeffdff00d86c62
Refname:    refs/heads/master
Author:     Matthew Wilcox <[email protected]>
AuthorDate: Thu Nov 9 20:15:14 2017 -0500
Committer:  Matthew Wilcox <[email protected]>
CommitDate: Tue Feb 6 15:07:20 2018 -0500

    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 <[email protected]>
---
 tools/testing/radix-tree/idr-test.c | 4 ++--
 1 file 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++)
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.