Commit 1c87733d authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

net_ns: add __rcu annotations

add __rcu annotation to (struct net)->gen, and use
rcu_dereference_protected() in net_assign_generic()
Signed-off-by: default avatarEric Dumazet <>
Signed-off-by: default avatarDavid S. Miller <>
parent 6e3f7faf
......@@ -88,7 +88,7 @@ struct net {
struct sk_buff_head wext_nlevents;
struct net_generic *gen;
struct net_generic __rcu *gen;
/* Note : following structs are cache line aligned */
......@@ -42,7 +42,9 @@ static int net_assign_generic(struct net *net, int id, void *data)
BUG_ON(id == 0);
ng = old_ng = net->gen;
old_ng = rcu_dereference_protected(net->gen,
ng = old_ng;
if (old_ng->len >= id)
goto assign;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment