]> git.baikalelectronics.ru Git - kernel.git/commit
netns: use a spin_lock to protect nsid management
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Thu, 7 May 2015 09:02:51 +0000 (11:02 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 10 May 2015 02:15:31 +0000 (22:15 -0400)
commite15655615e5921a6450b1d1bb3b4705f969cc44a
treede2de5b60d50cb6c8f47688e786cbc1790977155
parent95044282ad7185ef44a66b19e9dc6044982597ba
netns: use a spin_lock to protect nsid management

Before this patch, nsid were protected by the rtnl lock. The goal of this
patch is to be able to find a nsid without needing to hold the rtnl lock.

The next patch will introduce a netlink socket option to listen to all
netns that have a nsid assigned into the netns where the socket is opened.
Thus, it's important to call rtnl_net_notifyid() outside the spinlock, to
avoid a recursive lock (nsid are notified via rtnl). This was the main
reason of the previous patch.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/net_namespace.c