All of lore.kernel.org
 help / color / mirror / Atom feed
From: "YOSHIFUJI Hideaki/吉藤英明" <hideaki.yoshifuji@miraclelinux.com>
To: Nicholas Krause <xerofoify@gmail.com>, davem@davemloft.net
Cc: hideaki.yoshifuji@miraclelinux.com, ebiederm@xmission.com,
	edumazet@google.com, xiyou.wangcong@gmail.com,
	yoshfuji@linux-ipv6.org, johannes.berg@intel.com,
	nicolas.dichtel@6wind.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] neighbour: Convert if statment in the function, neigh_add_timer to a WARN_ON
Date: Tue, 02 Jun 2015 11:37:40 +0900	[thread overview]
Message-ID: <556D16F4.3060307@miraclelinux.com> (raw)
In-Reply-To: <1433188983-23207-1-git-send-email-xerofoify@gmail.com>

Nicholas Krause wrote:
> This converts the if statement for dumping the stack into a
> WARN_ON in order to make this function's debugging check
> simpler and have a cleaner output when this condition
> occurs inside this function for when bugs related to
> adding a duplicate neighbour table timer arise.
> 
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> ---
>  net/core/neighbour.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/net/core/neighbour.c b/net/core/neighbour.c
> index 3de6542..0bf71da 100644
> --- a/net/core/neighbour.c
> +++ b/net/core/neighbour.c
> @@ -165,11 +165,7 @@ static int neigh_forced_gc(struct neigh_table *tbl)
>  static void neigh_add_timer(struct neighbour *n, unsigned long when)
>  {
>  	neigh_hold(n);
> -	if (unlikely(mod_timer(&n->timer, when))) {
> -		printk("NEIGH: BUG, double timer add, state is %x\n",
> -		       n->nud_state);
> -		dump_stack();
> -	}
> +	WARN_ON(unlikely(mod_timer(&n->timer, when)));
>  }

NACK, please do not use WARN_ON for things with side effects.

--yoshfuji

       reply	other threads:[~2015-06-02  2:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1433188983-23207-1-git-send-email-xerofoify@gmail.com>
2015-06-02  2:37 ` YOSHIFUJI Hideaki/吉藤英明 [this message]
2015-06-02  3:37   ` [PATCH] neighbour: Convert if statment in the function, neigh_add_timer to a WARN_ON Cong Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=556D16F4.3060307@miraclelinux.com \
    --to=hideaki.yoshifuji@miraclelinux.com \
    --cc=davem@davemloft.net \
    --cc=ebiederm@xmission.com \
    --cc=edumazet@google.com \
    --cc=johannes.berg@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=xerofoify@gmail.com \
    --cc=xiyou.wangcong@gmail.com \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.