diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2021-04-01 07:46:49 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-04-16 11:43:21 +0200 |
commit | b1f6c6f39bd6a47edcedf2532491ba26b212ecb3 (patch) | |
tree | 08d725562dd1b25ef0fe8dba5351037be6986e1b /tools | |
parent | 9a7552daa93bf38f6975cb47f6f726d3e2b81a60 (diff) | |
download | linux-stable-b1f6c6f39bd6a47edcedf2532491ba26b212ecb3.tar.gz linux-stable-b1f6c6f39bd6a47edcedf2532491ba26b212ecb3.tar.bz2 linux-stable-b1f6c6f39bd6a47edcedf2532491ba26b212ecb3.zip |
idr test suite: Create anchor before launching throbber
[ Upstream commit 094ffbd1d8eaa27ed426feb8530cb1456348b018 ]
The throbber could race with creation of the anchor entry and cause the
IDR to have zero entries in it, which would cause the test to fail.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/radix-tree/idr-test.c | 4 |
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 4a9b451b7ba0..6ce7460f3c7a 100644 --- a/tools/testing/radix-tree/idr-test.c +++ b/tools/testing/radix-tree/idr-test.c @@ -301,11 +301,11 @@ void idr_find_test_1(int anchor_id, int throbber_id) pthread_t throbber; time_t start = time(NULL); - pthread_create(&throbber, NULL, idr_throbber, &throbber_id); - BUG_ON(idr_alloc(&find_idr, xa_mk_value(anchor_id), anchor_id, anchor_id + 1, GFP_KERNEL) != anchor_id); + pthread_create(&throbber, NULL, idr_throbber, &throbber_id); + rcu_read_lock(); do { int id = 0; |