mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-21 10:01:00 +00:00
idr test suite: Create anchor before launching throbber
[ Upstream commit 094ffbd1d8
]
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>
This commit is contained in:
parent
b9299c2bf5
commit
90b71ae8e5
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue