Messages in this thread | | | From | Matthew Wilcox <> | Subject | [PATCH 00/17] IDR patches for 4.15 | Date | Tue, 28 Nov 2017 13:32:55 -0800 |
| |
From: Matthew Wilcox <mawilcox@microsoft.com>
The patches here are of three types:
- Enhancing the test suite (fixing the build, adding a couple of new tests, fixing a bug in the test) - Replacing the 'extended' IDR API - Fixing some low-probability bugs
As far as the 'extended' IDR API goes, this was added by Chris Mi to permit a savvy user to use IDs up to ULONG_MAX in size (the traditional IDR API only permits IDs to be INT_MAX). It's harder to use, so we wouldn't want to convert all users over to it. But it can be made easier to use than it currently is, which is what I've done here. The principal way that I've made it easier to use is by introducing idr_alloc_u32(), which is what all but one of the existing users actually want.
The last patch at the end I thought of just now -- what happens when somebody adds an IDR entry with an ID > INT_MAX and then tries to iterate over all entries in the IDR using an old interface that can't return these large IDs? It's not safe to return those IDs, so I've settled for a dmesg warning and terminating the iteration.
Most of these patches have been sitting in my xarray tree in one form or another for over a month. I haven't seen anything from 0day to indicate a problem here, but then there are as yet very few users and I'm not sure 0day has covered any of them.
Matthew Wilcox (17): idr: Fix build radix tree test suite: Remove ARRAY_SIZE idr test suite: Fix ida_test_random() IDR test suite: Check handling negative end correctly idr: Delete idr_remove_ext function idr: Delete idr_replace_ext function idr: Delete idr_find_ext function idr: Add idr_alloc_u32 helper net sched actions: Convert to use idr_alloc_u32 cls_basic: Convert to use idr_alloc_u32 cls_bpf: Convert to use idr_alloc_u32 cls_flower: Convert to idr_alloc_u32 cls_u32: Reinstate cyclic allocation cls_u32: Convert to idr_alloc_u32 idr: Rename idr_alloc_ext to idr_alloc_ul idr: Rename idr_for_each_entry_ext idr: Warn if old iterators see large IDs
include/linux/idr.h | 109 ++++++++++-------------- include/linux/radix-tree.h | 17 +--- lib/idr.c | 143 +++++++++++++++++++++++--------- lib/radix-tree.c | 3 +- net/sched/act_api.c | 72 +++++++--------- net/sched/cls_basic.c | 33 ++++---- net/sched/cls_bpf.c | 32 ++++--- net/sched/cls_flower.c | 34 ++++---- net/sched/cls_u32.c | 51 +++++------- tools/testing/radix-tree/idr-test.c | 22 ++++- tools/testing/radix-tree/linux/kernel.h | 2 - 11 files changed, 267 insertions(+), 251 deletions(-)
-- 2.15.0
| |