提交 ec9c7809 编写于 作者: K Kirill Tkhai 提交者: David S. Miller

ovs: Remove rtnl_lock() from ovs_exit_net()

Here we iterate for_each_net() and removes
vport from alive net to the exiting net.

ovs_net::dps are protected by ovs_mutex(),
and the others, who change it (ovs_dp_cmd_new(),
__dp_destroy()) also take it.
The same with datapath::ports list.

So, we remove rtnl_lock() here.
Signed-off-by: NKirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 350311aa
...@@ -2363,12 +2363,10 @@ static void __net_exit ovs_exit_net(struct net *dnet) ...@@ -2363,12 +2363,10 @@ static void __net_exit ovs_exit_net(struct net *dnet)
list_for_each_entry_safe(dp, dp_next, &ovs_net->dps, list_node) list_for_each_entry_safe(dp, dp_next, &ovs_net->dps, list_node)
__dp_destroy(dp); __dp_destroy(dp);
rtnl_lock();
down_read(&net_rwsem); down_read(&net_rwsem);
for_each_net(net) for_each_net(net)
list_vports_from_net(net, dnet, &head); list_vports_from_net(net, dnet, &head);
up_read(&net_rwsem); up_read(&net_rwsem);
rtnl_unlock();
/* Detach all vports from given namespace. */ /* Detach all vports from given namespace. */
list_for_each_entry_safe(vport, vport_next, &head, detach_list) { list_for_each_entry_safe(vport, vport_next, &head, detach_list) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册