Skip to content
Commit 4b0ad076 authored by Matthew Wilcox's avatar Matthew Wilcox
Browse files

idr: Fix handling of IDs above INT_MAX

Khalid reported that the kernel selftests are currently failing:

selftests: test_bpf.sh
========================================
test_bpf: [FAIL]
not ok 1..8 selftests:  test_bpf.sh [FAIL]

He bisected it to 6ce711f2

 ("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: default avatarKhalid Aziz <khalid.aziz@oracle.com>
Tested-by: default avatarKhalid Aziz <khalid.aziz@oracle.com>
Signed-off-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
parent 3d4d5d61
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment