From: Eric W. Biederman Date: Thu, 27 Sep 2007 05:40:08 +0000 (-0700) Subject: [NETNS]: Simplify the network namespace list locking rules. X-Git-Tag: v2.6.24-rc1~1454^2~330 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4618d39a34dab316090263b42cd8799f31ce277;p=pandora-kernel.git [NETNS]: Simplify the network namespace list locking rules. Denis V. Lunev 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 Signed-off-by: David S. Miller --- Reading git-diff-tree failed