Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 490645d0 authored by Matthew Wilcox's avatar Matthew Wilcox
Browse files

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: default avatarMatthew Wilcox <mawilcox@microsoft.com>
parent 051803c0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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++)