aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2007-09-27 01:40:08 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:52:55 -0400
commitf4618d39a34dab316090263b42cd8799f31ce277 (patch)
tree75db202b492da1797145fde455b0c4c89cf41767 /include/net
parent32db927686f6d475fc05b6229f82ed576c0c8096 (diff)
[NETNS]: Simplify the network namespace list locking rules.
Denis V. Lunev <den@sw.ru> noticed that the locking rules for the network namespace list are over complicated and broken. In particular the current register_netdev_notifier currently does not take any lock making the for_each_net iteration racy with network namespace creation and destruction. Oops. The fact that we need to use for_each_net in rtnl_unlock() when the rtnetlink support becomes per network namespace makes designing the proper locking tricky. In addition we need to be able to call rtnl_lock() and rtnl_unlock() when we have the net_mutex held. After thinking about it and looking at the alternatives carefully it looks like the simplest and most maintainable solution is to remove net_list_mutex altogether, and to use the rtnl_mutex instead. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/net_namespace.h3
1 files changed, 0 insertions, 3 deletions
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 13b0e3b547f0..934c840b5941 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -96,9 +96,6 @@ static inline void release_net(struct net *net)
96#endif 96#endif
97} 97}
98 98
99extern void net_lock(void);
100extern void net_unlock(void);
101
102#define for_each_net(VAR) \ 99#define for_each_net(VAR) \
103 list_for_each_entry(VAR, &net_namespace_list, list) 100 list_for_each_entry(VAR, &net_namespace_list, list)
104 101