public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 01/21] grace: replace BUG_ON by WARN_ONCE in exit_net hook
       [not found] ` <4fdc4264-e338-6ee8-a662-7d98b45733a1-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
@ 2017-11-06 13:22   ` Vasily Averin
  2017-11-06 20:02     ` J. Bruce Fields
       [not found]     ` <a059abdd-e727-adcb-7b43-976be1d0a08e-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
  0 siblings, 2 replies; 4+ messages in thread
From: Vasily Averin @ 2017-11-06 13:22 UTC (permalink / raw)
  To: netdev-u79uwXL29TY76Z2rM5mHXA
  Cc: J. Bruce Fields, Jeff Layton,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

Signed-off-by: Vasily Averin <vvs-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
---
 fs/nfs_common/grace.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/nfs_common/grace.c b/fs/nfs_common/grace.c
index 420d3a0..1bd6599 100644
--- a/fs/nfs_common/grace.c
+++ b/fs/nfs_common/grace.c
@@ -104,7 +104,9 @@ grace_exit_net(struct net *net)
 {
 	struct list_head *grace_list = net_generic(net, grace_net_id);
 
-	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__);
 }
 
 static struct pernet_operations grace_net_ops = {
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v3 01/21] grace: replace BUG_ON by WARN_ONCE in exit_net hook
  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>
  1 sibling, 0 replies; 4+ messages in thread
From: J. Bruce Fields @ 2017-11-06 20:02 UTC (permalink / raw)
  To: Vasily Averin; +Cc: netdev, Jeff Layton, linux-nfs@vger.kernel.org

I'm assuming you want me to apply this (and the following lockd patch),
but I'm not clear why this is part of a bigger series going to netdev.

--b.

On Mon, Nov 06, 2017 at 04:22:48PM +0300, Vasily Averin wrote:
> Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
> ---
>  fs/nfs_common/grace.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/nfs_common/grace.c b/fs/nfs_common/grace.c
> index 420d3a0..1bd6599 100644
> --- a/fs/nfs_common/grace.c
> +++ b/fs/nfs_common/grace.c
> @@ -104,7 +104,9 @@ grace_exit_net(struct net *net)
>  {
>  	struct list_head *grace_list = net_generic(net, grace_net_id);
>  
> -	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__);
>  }
>  
>  static struct pernet_operations grace_net_ops = {
> -- 
> 2.7.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* 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

* Re: [PATCH v3 01/21] grace: replace BUG_ON by WARN_ONCE in exit_net hook
       [not found]     ` <a059abdd-e727-adcb-7b43-976be1d0a08e-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
@ 2017-11-09 15:06       ` J. Bruce Fields
  0 siblings, 0 replies; 4+ messages in thread
From: J. Bruce Fields @ 2017-11-09 15:06 UTC (permalink / raw)
  To: Vasily Averin
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, Jeff Layton,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

Applied for 4.15, thanks.--b.

On Mon, Nov 06, 2017 at 04:22:48PM +0300, Vasily Averin wrote:
> Signed-off-by: Vasily Averin <vvs-5HdwGun5lf+gSpxsJD1C4w@public.gmane.org>
> ---
>  fs/nfs_common/grace.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/nfs_common/grace.c b/fs/nfs_common/grace.c
> index 420d3a0..1bd6599 100644
> --- a/fs/nfs_common/grace.c
> +++ b/fs/nfs_common/grace.c
> @@ -104,7 +104,9 @@ grace_exit_net(struct net *net)
>  {
>  	struct list_head *grace_list = net_generic(net, grace_net_id);
>  
> -	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__);
>  }
>  
>  static struct pernet_operations grace_net_ops = {
> -- 
> 2.7.4
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ 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