Skip to content

Commit

Permalink
idr: fix RCU lockdep splat in idr_get_next()
Browse files Browse the repository at this point in the history
Convert to rcu_dereference_raw() given that many callers may have many
different locking models.

Located-by: Miles Lane <[email protected]>
Tested-by: Miles Lane <[email protected]>
Signed-off-by: Paul E. McKenney <[email protected]>
  • Loading branch information
paulmck committed Jun 23, 2010
1 parent f3b577d commit 94bfa3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/idr.c
Original file line number Diff line number Diff line change
Expand Up @@ -602,15 +602,15 @@ void *idr_get_next(struct idr *idp, int *nextidp)
/* find first ent */
n = idp->layers * IDR_BITS;
max = 1 << n;
p = rcu_dereference(idp->top);
p = rcu_dereference_raw(idp->top);
if (!p)
return NULL;

while (id < max) {
while (n > 0 && p) {
n -= IDR_BITS;
*paa++ = p;
p = rcu_dereference(p->ary[(id >> n) & IDR_MASK]);
p = rcu_dereference_raw(p->ary[(id >> n) & IDR_MASK]);
}

if (p) {
Expand Down

0 comments on commit 94bfa3b

Please sign in to comment.