From: Vasily Averin Subject: [PATCH v5 08/13] l2tp: exit_net cleanup check added Date: Sun, 12 Nov 2017 22:30:31 +0300 Message-ID: <45fec9d9-c56a-ccef-b3e5-67b625c54824@virtuozzo.com> References: 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]:36852 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750800AbdKLTad (ORCPT ); Sun, 12 Nov 2017 14:30:33 -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 vACJUVnq006359 for ; Sun, 12 Nov 2017 22:30:32 +0300 (MSK) In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: Be sure that l2tp_session_hlist array initialized in net_init hook was return to initial state. Signed-off-by: Vasily Averin --- net/l2tp/l2tp_core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c index 02d6110..fabc404 100644 --- a/net/l2tp/l2tp_core.c +++ b/net/l2tp/l2tp_core.c @@ -1888,6 +1888,7 @@ static __net_exit void l2tp_exit_net(struct net *net) { struct l2tp_net *pn = l2tp_pernet(net); struct l2tp_tunnel *tunnel = NULL; + int hash; rcu_read_lock_bh(); list_for_each_entry_rcu(tunnel, &pn->l2tp_tunnel_list, list) { @@ -1897,6 +1898,9 @@ static __net_exit void l2tp_exit_net(struct net *net) flush_workqueue(l2tp_wq); rcu_barrier(); + + for (hash = 0; hash < L2TP_HASH_SIZE_2; hash++) + WARN_ON_ONCE(!hlist_empty(&pn->l2tp_session_hlist[hash])); } static struct pernet_operations l2tp_net_ops = { -- 2.7.4