idr: Fix handling of IDs above INT_MAX
Khalid reported that the kernel selftests are currently failing:
not ok 1..8 selftests: test_bpf.sh [FAIL]
He bisected it to 6ce711f2750031d12cec91384ac5cfa0a485b60a ("idr: Make
1-based IDRs more efficient").
The root cause is doing a signed comparison in idr_alloc_u32() instead
of an unsigned comparison. I went looking for any similar problems and
found a couple (which would each result in the failure to warn in two
situations that aren't supposed to happen).
I knocked up a few test-cases to prove that I was right and added them
to the test-suite.
Reported-by: Khalid Aziz <firstname.lastname@example.org>
Tested-by: Khalid Aziz <email@example.com>
Signed-off-by: Matthew Wilcox <firstname.lastname@example.org>
2 files changed