[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAM_iQpXc8Sbo7UfJgfBNtv__dYnQzW29Jot+DKDHTQJ0aYqZ6A@mail.gmail.com>
Date: Mon, 1 Jun 2015 20:37:21 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: YOSHIFUJI Hideaki/吉藤英明
<hideaki.yoshifuji@...aclelinux.com>
Cc: Nicholas Krause <xerofoify@...il.com>,
David Miller <davem@...emloft.net>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Eric Dumazet <edumazet@...gle.com>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
johannes.berg@...el.com,
Nicolas Dichtel <nicolas.dichtel@...nd.com>,
Linux Kernel Network Developers <netdev@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] neighbour: Convert if statment in the function,
neigh_add_timer to a WARN_ON
On Mon, Jun 1, 2015 at 7:37 PM, YOSHIFUJI Hideaki/吉藤英明
<hideaki.yoshifuji@...aclelinux.com> wrote:
> 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@...il.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.
Just:
int ret = mod_timer(...);
WARN_ON(ret);
...
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists