Skip to content

Commit

Permalink
net: convert to rcu_dereference_index_check()
Browse files Browse the repository at this point in the history
The task_cls_classid() function applies rcu_dereference() to integers,
which does not work with the shiny new sparse-based checking in
rcu_dereference().  This commit therefore moves to the new RCU API
rcu_dereference_index_check().

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Paul E. McKenney committed Aug 20, 2010
1 parent 763008c commit d34a166
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/net/cls_cgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ static inline u32 task_cls_classid(struct task_struct *p)
return 0;

rcu_read_lock();
id = rcu_dereference(net_cls_subsys_id);
id = rcu_dereference_index_check(net_cls_subsys_id,
rcu_read_lock_held());
if (id >= 0)
classid = container_of(task_subsys_state(p, id),
struct cgroup_cls_state, css)->classid;
Expand Down

0 comments on commit d34a166

Please sign in to comment.