[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <151551004908.4318.11080493179034599392.stgit@localhost.localdomain>
Date: Tue, 09 Jan 2018 18:00:57 +0300
From: Kirill Tkhai <ktkhai@...tuozzo.com>
To: netdev@...r.kernel.org, davem@...emloft.net
Cc: eric.dumazet@...il.com, ktkhai@...tuozzo.com, ebiederm@...ssion.com
Subject: [PATCH v2 3/3] net: Remove spinlock from get_net_ns_by_id()
idr_find() is safe under rcu_read_lock() and
maybe_get_net() guarantees that net is alive.
Signed-off-by: Kirill Tkhai <ktkhai@...tuozzo.com>
---
net/core/net_namespace.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 497135f314ce..5f9e18b31a1a 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -273,11 +273,9 @@ struct net *get_net_ns_by_id(struct net *net, int id)
return NULL;
rcu_read_lock();
- spin_lock_bh(&net->nsid_lock);
peer = idr_find(&net->netns_ids, id);
if (peer)
peer = maybe_get_net(peer);
- spin_unlock_bh(&net->nsid_lock);
rcu_read_unlock();
return peer;
Powered by blists - more mailing lists