diff options
| author | Matthew Wilcox <mawilcox@microsoft.com> | 2017-11-28 14:27:14 -0500 |
|---|---|---|
| committer | Matthew Wilcox <mawilcox@microsoft.com> | 2018-02-06 15:07:20 -0500 |
| commit | 6e6d301490936789ff57daaaaf63f44d928a4028 (patch) | |
| tree | e74910fcfe54a903843c6cc4e6931ed80597dbe0 /tools | |
| parent | 490645d027c5925b30c88b9c7a663850a641d15d (diff) | |
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 <mawilcox@microsoft.com>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/testing/radix-tree/idr-test.c | 1 |
1 files changed, 1 insertions, 0 deletions
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) | |||
| 207 | assert(idr_alloc(&idr, item, i, i + 10, GFP_KERNEL) == i); | 207 | assert(idr_alloc(&idr, item, i, i + 10, GFP_KERNEL) == i); |
| 208 | } | 208 | } |
| 209 | assert(idr_alloc(&idr, DUMMY_PTR, i - 2, i, GFP_KERNEL) == -ENOSPC); | 209 | assert(idr_alloc(&idr, DUMMY_PTR, i - 2, i, GFP_KERNEL) == -ENOSPC); |
| 210 | assert(idr_alloc(&idr, DUMMY_PTR, i - 2, i + 10, GFP_KERNEL) == -ENOSPC); | ||
| 210 | 211 | ||
| 211 | idr_for_each(&idr, item_idr_free, &idr); | 212 | idr_for_each(&idr, item_idr_free, &idr); |
| 212 | idr_destroy(&idr); | 213 | idr_destroy(&idr); |
