diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-10-24 23:20:11 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-25 17:18:27 -0400 |
commit | 1c87733d0682547050ccccb400cdac425fa43b39 (patch) | |
tree | 8ec9de7722a2be0e97d9ad6a04d12fb0d298b201 /net/core | |
parent | 6e3f7faf3e8a3e226b1a6b955aac12abf2f2e1b6 (diff) |
net_ns: add __rcu annotations
add __rcu annotation to (struct net)->gen, and use
rcu_dereference_protected() in net_assign_generic()
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/net_namespace.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index c988e685433a..3f860261c5ee 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c | |||
@@ -42,7 +42,9 @@ static int net_assign_generic(struct net *net, int id, void *data) | |||
42 | BUG_ON(!mutex_is_locked(&net_mutex)); | 42 | BUG_ON(!mutex_is_locked(&net_mutex)); |
43 | BUG_ON(id == 0); | 43 | BUG_ON(id == 0); |
44 | 44 | ||
45 | ng = old_ng = net->gen; | 45 | old_ng = rcu_dereference_protected(net->gen, |
46 | lockdep_is_held(&net_mutex)); | ||
47 | ng = old_ng; | ||
46 | if (old_ng->len >= id) | 48 | if (old_ng->len >= id) |
47 | goto assign; | 49 | goto assign; |
48 | 50 | ||