diff options
author | Kirill Tkhai <ktkhai@virtuozzo.com> | 2018-01-16 12:31:54 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-01-17 15:42:35 -0500 |
commit | 42157277af17d5c05946c700eb03877d60760d3c (patch) | |
tree | e40d3af152a62455f84d43235b6a5132694ae8b9 /net/core | |
parent | 0c06bea919f3289368a023d1a62a1bc319617fa3 (diff) | |
download | linux-42157277af17d5c05946c700eb03877d60760d3c.tar.bz2 |
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@virtuozzo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/net_namespace.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index 3c77d84ad60d..1ccb953b3b09 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; |