From 0412bd931f5f94d1054e958415c4a945d8ee62f4 Mon Sep 17 00:00:00 2001 From: Hannes Frederic Sowa Date: Fri, 8 Apr 2016 22:55:01 +0200 Subject: vxlan: synchronously and race-free destruction of vxlan sockets Due to the fact that the udp socket is destructed asynchronously in a work queue, we have some nondeterministic behavior during shutdown of vxlan tunnels and creating new ones. Fix this by keeping the destruction process synchronous in regards to the user space process so IFF_UP can be reliably set. udp_tunnel_sock_release destroys vs->sock->sk if reference counter indicates so. We expect to have the same lifetime of vxlan_sock and vxlan_sock->sock->sk even in fast paths with only rcu locks held. So only destruct the whole socket after we can be sure it cannot be found by searching vxlan_net->sock_list. Cc: Eric Dumazet Cc: Jiri Benc Cc: Marcelo Ricardo Leitner Signed-off-by: Hannes Frederic Sowa Signed-off-by: David S. Miller --- include/net/vxlan.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include/net/vxlan.h') diff --git a/include/net/vxlan.h b/include/net/vxlan.h index 2f168f0ea32c..d442eb3129cd 100644 --- a/include/net/vxlan.h +++ b/include/net/vxlan.h @@ -184,9 +184,7 @@ struct vxlan_metadata { /* per UDP socket information */ struct vxlan_sock { struct hlist_node hlist; - struct work_struct del_work; struct socket *sock; - struct rcu_head rcu; struct hlist_head vni_list[VNI_HASH_SIZE]; atomic_t refcnt; u32 flags; -- cgit v1.2.3