[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20171128213312.28983-5-willy@infradead.org>
Date: Tue, 28 Nov 2017 13:32:59 -0800
From: Matthew Wilcox <willy@...radead.org>
To: unlisted-recipients:; (no To-header on input)
Cc: Matthew Wilcox <mawilcox@...rosoft.com>,
Chris Mi <chrism@...lanox.com>, Jiri Pirko <jiri@...lanox.com>,
"David S . Miller" <davem@...emloft.net>,
Cong Wang <xiyou.wangcong@...il.com>,
Jamal Hadi Salim <jhs@...atatu.com>,
Daniel Borkmann <daniel@...earbox.net>,
Eric Biggers <ebiggers@...gle.com>,
Lai Jiangshan <laijs@...fujitsu.com>,
Tejun Heo <tj@...nel.org>, Rehas Sachdeva <aquannie@...il.com>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 04/17] IDR test suite: Check handling negative end correctly
From: Matthew Wilcox <mawilcox@...rosoft.com>
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@...rosoft.com>
---
tools/testing/radix-tree/idr-test.c | 1 +
1 file changed, 1 insertion(+)
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);
--
2.15.0
Powered by blists - more mailing lists