From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vasily Averin Subject: [PATCH v4 04/18] vxlan: exit_net cleanup checks added Date: Sun, 12 Nov 2017 11:42:00 +0300 Message-ID: <0c75cf66-73cd-b7f5-2612-fd864f45cd2e@virtuozzo.com> References: <9dfa013e-9098-e155-9c47-a73753338288@virtuozzo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: netdev@vger.kernel.org Return-path: Received: from mailhub.sw.ru ([195.214.232.25]:25169 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752012AbdKLImC (ORCPT ); Sun, 12 Nov 2017 03:42:02 -0500 Received: from [172.16.24.21] (msk-vpn.virtuozzo.com [195.214.232.6]) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id vAC8g07s011604 for ; Sun, 12 Nov 2017 11:42:00 +0300 (MSK) In-Reply-To: <9dfa013e-9098-e155-9c47-a73753338288@virtuozzo.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: Be sure that sock_list array initialized in net_init hook was return to initial state Signed-off-by: Vasily Averin --- drivers/net/vxlan.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index d7c49cf..766a41b 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -3704,6 +3704,7 @@ static void __net_exit vxlan_exit_net(struct net *net) struct vxlan_net *vn = net_generic(net, vxlan_net_id); struct vxlan_dev *vxlan, *next; struct net_device *dev, *aux; + unsigned int h; LIST_HEAD(list); rtnl_lock(); @@ -3723,6 +3724,10 @@ static void __net_exit vxlan_exit_net(struct net *net) unregister_netdevice_many(&list); rtnl_unlock(); + + for (h = 0; h < PORT_HASH_SIZE; ++h) + if (WARN_ON_ONCE(!hlist_empty(&vn->sock_list[h]))) + break; } static struct pernet_operations vxlan_net_ops = { -- 2.7.4