netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Kefeng Wang <wangkefeng.wang@huawei.com>,
	davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH 1/3] ipv4: icmp: use icmp_sk_exit()
Date: Fri, 22 Feb 2019 09:16:10 -0800	[thread overview]
Message-ID: <c00c9299-7cf7-4323-b9db-50be7a6a8dbf@gmail.com> (raw)
In-Reply-To: <bb408779-5ddb-f9ef-e16b-1d0d7a5c3719@gmail.com>



On 02/22/2019 09:11 AM, Eric Dumazet wrote:
> 
> 
> On 02/21/2019 05:57 PM, Kefeng Wang wrote:
>> Simply use icmp_sk_exit() when inet_ctl_sock_create() fail in icmp_sk_init().
>>
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>> ---
>>  net/ipv4/icmp.c | 4 +---
>>  1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
>> index 065997f414e6..364cfe5e414b 100644
>> --- a/net/ipv4/icmp.c
>> +++ b/net/ipv4/icmp.c
>> @@ -1245,9 +1245,7 @@ static int __net_init icmp_sk_init(struct net *net)
>>  	return 0;
>>  
>>  fail:
>> -	for_each_possible_cpu(i)
>> -		inet_ctl_sock_destroy(*per_cpu_ptr(net->ipv4.icmp_sk, i));
>> -	free_percpu(net->ipv4.icmp_sk);
>> +	icmp_sk_exit(net);
>>  	return err;
>>  }
>>  
>>
> 
> 
> I do not like this. Future changes in icmp_sk_exit() might trigger a bug in this seldom tested path.
> 

Oh I see the next patches, now it makes sense.

Please send a proper patch series, with a cover letter, so that it is obvious.

Also you need to include "net-next" instead of plain [PATCH] to express this targets net-next tree.

Carefully read Documentation/networking/netdev-FAQ.rst

Thank you.

      reply	other threads:[~2019-02-22 17:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-22  1:57 [PATCH 1/3] ipv4: icmp: use icmp_sk_exit() Kefeng Wang
2019-02-22  1:57 ` [PATCH 2/3] ipv6: icmp: use icmpv6_sk_exit() Kefeng Wang
2019-02-22  1:58 ` [PATCH 3/3] ipv6: icmp: use percpu allocation Kefeng Wang
2019-02-22 17:11 ` [PATCH 1/3] ipv4: icmp: use icmp_sk_exit() Eric Dumazet
2019-02-22 17:16   ` Eric Dumazet [this message]

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=c00c9299-7cf7-4323-b9db-50be7a6a8dbf@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=wangkefeng.wang@huawei.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).