diff mbox series

[v3,11/21] clusterip: exit_net cleanup check added

Message ID 66995620-efe8-59ed-9097-a4fd96e30ae1@virtuozzo.com
State Changes Requested, archived
Delegated to: David Miller
Headers show
Series exit_net checks for objects initialized in net_init hook | expand

Commit Message

Vasily Averin Nov. 6, 2017, 1:24 p.m. UTC
Be sure that configs list initialized in net_init hook was return
to initial state.

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
 net/ipv4/netfilter/ipt_CLUSTERIP.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Jozsef Kadlecsik Nov. 6, 2017, 1:40 p.m. UTC | #1
Hello Vasily,

On Mon, 6 Nov 2017, Vasily Averin wrote:

> Be sure that configs list initialized in net_init hook was return
> to initial state.

What is the goal of the patch series you sent in the third version in a 
row?

- If the deinitializations are missing from the files, the patches 
  do not fix them, just emit warnings.
- If the deinitializations are not missing, the patches are totally 
  unnecessary.

It looks like debugging... but not expressed that way, neither in the 
subject lines nor in the patch descriptions.

Best regards,
Jozsef

> Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
> ---
>  net/ipv4/netfilter/ipt_CLUSTERIP.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
> index 17b4ca5..4364a88 100644
> --- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
> +++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
> @@ -819,6 +819,9 @@ static void clusterip_net_exit(struct net *net)
>  	cn->procdir = NULL;
>  #endif
>  	nf_unregister_net_hook(net, &cip_arp_ops);
> +	WARN_ONCE(!list_empty(&cn->configs),
> +		  "net %x %s: configs list is not empty\n",
> +		  net->ns.inum, __func__);
>  }
>  
>  static struct pernet_operations clusterip_net_ops = {
> -- 
> 2.7.4
> 
> 

-
E-mail  : kadlec@blackhole.kfki.hu, kadlecsik.jozsef@wigner.mta.hu
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics, Hungarian Academy of Sciences
          H-1525 Budapest 114, POB. 49, Hungary
diff mbox series

Patch

diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
index 17b4ca5..4364a88 100644
--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
+++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
@@ -819,6 +819,9 @@  static void clusterip_net_exit(struct net *net)
 	cn->procdir = NULL;
 #endif
 	nf_unregister_net_hook(net, &cip_arp_ops);
+	WARN_ONCE(!list_empty(&cn->configs),
+		  "net %x %s: configs list is not empty\n",
+		  net->ns.inum, __func__);
 }
 
 static struct pernet_operations clusterip_net_ops = {