From: Matthew Wilcox Date: Tue, 28 Nov 2017 19:27:14 +0000 (-0500) Subject: IDR test suite: Check handling negative end correctly X-Git-Tag: v5.15~9424^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6e6d301490936789ff57daaaaf63f44d928a4028;p=platform%2Fkernel%2Flinux-starfive.git IDR test suite: Check handling negative end correctly One of the charming quirks of the idr_alloc() interface is that you can pass a negative end and it will be interpreted as "maximum". Ensure we don't break that. Signed-off-by: Matthew Wilcox --- diff --git a/tools/testing/radix-tree/idr-test.c b/tools/testing/radix-tree/idr-test.c index 193450b29bf0..892ef8855b02 100644 --- a/tools/testing/radix-tree/idr-test.c +++ b/tools/testing/radix-tree/idr-test.c @@ -207,6 +207,7 @@ void idr_checks(void) assert(idr_alloc(&idr, item, i, i + 10, GFP_KERNEL) == i); } assert(idr_alloc(&idr, DUMMY_PTR, i - 2, i, GFP_KERNEL) == -ENOSPC); + assert(idr_alloc(&idr, DUMMY_PTR, i - 2, i + 10, GFP_KERNEL) == -ENOSPC); idr_for_each(&idr, item_idr_free, &idr); idr_destroy(&idr);