Commit 094ffbd1 authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle)
Browse files

idr test suite: Create anchor before launching throbber



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: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
parent 70358641
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;