public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v3 01/21] grace: replace BUG_ON by WARN_ONCE in exit_net hook
@ 2017-11-07 12:26 Alexey Dobriyan
  0 siblings, 0 replies; 4+ messages in thread
From: Alexey Dobriyan @ 2017-11-07 12:26 UTC (permalink / raw)
  To: vvs; +Cc: netdev, davem

> -	BUG_ON(!list_empty(grace_list));
> +	WARN_ONCE(!list_empty(grace_list),
> +		  "net %x %s: grace_list is not empty\n",
> +		  net->ns.inum, __func__);

* printing __func__ is unnecessary as it will be on top of the stacktrace anyway,
* message duplicates condition
* printing netns id in netns ->exit hook also looks like pointless
  information: for kernel dumps you want struct net pointer right away.
  You wrote admins want to know which container triggered the message
  but what will they do with that information?


I'd say WARN_ONCE(!list_empty()) is enough.
BUG_ON if you ship with crashdumps by default.

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [PATCH v2 00/21] exit_net checks for objects initialized in net_init hook
@ 2017-11-05 16:49 Vasily Averin
       [not found] ` <4fdc4264-e338-6ee8-a662-7d98b45733a1-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Vasily Averin @ 2017-11-05 16:49 UTC (permalink / raw)
  To: netdev

This patch set checks that lists initialized in net_init hooks were
return to initial state at end of net_exit hooks.

I hope such checks allows to detect leaked per-netns objects.
Also I hope that all new pernet_operations will inherit such checks too.

I assume that elements added into per-net lists should not live longer than net namespace,
and should be deleted from the list. I think exit_net hook is good place for such check.

Recently I've found lost list_entry and enabled timer on stop of net namespace.
Then I've reviewed all existing pernet_operations and found that many drivers
have such checks already. So I decided to complete this task and add such checks
into all affected subsystems.

v2:
- net pointer removed from output
- fixed compilation for phonet driver

Vasily Averin (21):
  exit_net cleanup: geneve sock_list check
  ppp: exit_net cleanup checks added
  vxlan: exit_net cleanup checks added
  netdev: exit_net cleanup check added
  nfs4blocklayout: exit_net cleanup check added
  nfs client: exit_net cleanup check added
  fib_notifier: exit_net cleanup check added
  fib_rules: exit_net cleanup check added
  clusterip: exit_net cleanup check added
  xfrm6_tunnel: exit_net cleanup check added
  af_key: replace BUG_ON on WARN_ON in net_exit hook
  l2tp: exit_net cleanup check added
  nf_tables: exit_net cleanup check added
  nfnetlink_log: exit_net cleanup check added
  nfnetlink_gueue: exit_net cleanup check added
  x_tables: exit_net cleanup check added
  hashlimit: exit_net cleanup check added
  recent: exit_net cleanup check added
  packet: exit_net cleanup check added
  phonet: exit_net cleanup check added
  sunrpc: exit_net cleanup check added

 drivers/net/geneve.c               |  2 ++
 drivers/net/ppp/ppp_generic.c      |  4 ++++
 drivers/net/vxlan.c                |  6 ++++++
 fs/nfs/blocklayout/rpc_pipefs.c    |  2 ++
 fs/nfs/client.c                    |  4 ++++
 net/core/dev.c                     |  3 +++
 net/core/fib_notifier.c            |  7 +++++++
 net/core/fib_rules.c               |  7 +++++++
 net/ipv4/netfilter/ipt_CLUSTERIP.c |  2 ++
 net/ipv6/xfrm6_tunnel.c            | 12 ++++++++++++
 net/key/af_key.c                   |  2 +-
 net/l2tp/l2tp_core.c               |  6 ++++++
 net/netfilter/nf_tables_api.c      |  9 +++++++++
 net/netfilter/nfnetlink_log.c      |  6 ++++++
 net/netfilter/nfnetlink_queue.c    |  7 +++++++
 net/netfilter/x_tables.c           | 10 ++++++++++
 net/netfilter/xt_hashlimit.c       |  4 ++++
 net/netfilter/xt_recent.c          |  4 ++++
 net/packet/af_packet.c             |  2 ++
 net/phonet/pn_dev.c                |  4 ++++
 net/sunrpc/sunrpc_syms.c           |  4 ++++
 21 files changed, 106 insertions(+), 1 deletion(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-09 15:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-07 12:26 [PATCH v3 01/21] grace: replace BUG_ON by WARN_ONCE in exit_net hook Alexey Dobriyan
  -- strict thread matches above, loose matches on Subject: below --
2017-11-05 16:49 [PATCH v2 00/21] exit_net checks for objects initialized in net_init hook Vasily Averin
     [not found] ` <4fdc4264-e338-6ee8-a662-7d98b45733a1-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
2017-11-06 13:22   ` [PATCH v3 01/21] grace: replace BUG_ON by WARN_ONCE in exit_net hook Vasily Averin
2017-11-06 20:02     ` J. Bruce Fields
     [not found]     ` <a059abdd-e727-adcb-7b43-976be1d0a08e-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
2017-11-09 15:06       ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox