Re: [PATCH] idr: fix a subtle bug in idr_get_next()

2013-02-05 Thread David Teigland
On Sat, Feb 02, 2013 at 03:11:35PM -0800, Tejun Heo wrote: > On Sat, Feb 02, 2013 at 03:10:48PM -0800, Tejun Heo wrote: > > Fix it by ensuring proceeding to the next slot doesn't carry over the > > unaligned offset - ie. use round_up(id + 1, slot_distance) instead of > > id += slot_distance. > > >

Re: [PATCH] idr: fix a subtle bug in idr_get_next()

2013-02-04 Thread Tejun Heo
Hey, Li. On Mon, Feb 04, 2013 at 11:39:50AM +0800, Li Zefan wrote: > > Fix it by ensuring proceeding to the next slot doesn't carry over the > > unaligned offset - ie. use round_up(id + 1, slot_distance) instead of > > id += slot_distance. > > > > Signed-off-by: Tejun Heo > > Don't we need to c

Re: [PATCH] idr: fix a subtle bug in idr_get_next()

2013-02-03 Thread Li Zefan
On 2013/2/3 7:10, Tejun Heo wrote: > The iteration logic of idr_get_next() is borrowed mostly verbatim from > idr_for_each(). It walks down the tree looking for the slot matching > the current ID. If the matching slot is not found, the ID is > incremented by the distance of single slot at the giv

Re: [PATCH] idr: fix a subtle bug in idr_get_next()

2013-02-03 Thread Hugh Dickins
On Sat, 2 Feb 2013, Randy Dunlap wrote: > On 02/02/13 15:11, Tejun Heo wrote: > > On Sat, Feb 02, 2013 at 03:10:48PM -0800, Tejun Heo wrote: > >> Fix it by ensuring proceeding to the next slot doesn't carry over the > >> unaligned offset - ie. use round_up(id + 1, slot_distance) instead of > >> id

Re: [PATCH] idr: fix a subtle bug in idr_get_next()

2013-02-02 Thread Randy Dunlap
On 02/02/13 15:11, Tejun Heo wrote: > On Sat, Feb 02, 2013 at 03:10:48PM -0800, Tejun Heo wrote: >> Fix it by ensuring proceeding to the next slot doesn't carry over the >> unaligned offset - ie. use round_up(id + 1, slot_distance) instead of >> id += slot_distance. >> >> Signed-off-by: Tejun Heo

Re: [PATCH] idr: fix a subtle bug in idr_get_next()

2013-02-02 Thread Tejun Heo
On Sat, Feb 02, 2013 at 03:10:48PM -0800, Tejun Heo wrote: > Fix it by ensuring proceeding to the next slot doesn't carry over the > unaligned offset - ie. use round_up(id + 1, slot_distance) instead of > id += slot_distance. > > Signed-off-by: Tejun Heo > Reported-by: David Teigland > Cc: KAMEZ

[PATCH] idr: fix a subtle bug in idr_get_next()

2013-02-02 Thread Tejun Heo
The iteration logic of idr_get_next() is borrowed mostly verbatim from idr_for_each(). It walks down the tree looking for the slot matching the current ID. If the matching slot is not found, the ID is incremented by the distance of single slot at the given level and repeats. The implementation a