From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
To: Eric Dumazet <eric.dumazet@gmail.com>,
Nikolay Aleksandrov <razor@blackwall.org>
Cc: netdev@vger.kernel.org, davem@davemloft.net
Subject: Re: [PATCH net-next 7/9] net: ipmr: remove SLAB_PANIC
Date: Sat, 21 Nov 2015 15:27:03 +0100 [thread overview]
Message-ID: <56507F37.8070708@cumulusnetworks.com> (raw)
In-Reply-To: <1448115813.22599.289.camel@edumazet-glaptop2.roam.corp.google.com>
On 11/21/2015 03:23 PM, Eric Dumazet wrote:
> On Sat, 2015-11-21 at 14:01 +0100, Nikolay Aleksandrov wrote:
>> From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
>>
>> It's not necessary to panic upon allocation failure, returning an error
>> at that point is okay because user-space won't be able to use any of the
>> ops since they didn't get registered and the default table is null.
>>
>> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
>> ---
>> net/ipv4/ipmr.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
>> index a006d96d6cd9..2c7fa584a274 100644
>> --- a/net/ipv4/ipmr.c
>> +++ b/net/ipv4/ipmr.c
>> @@ -2675,7 +2675,7 @@ int __init ip_mr_init(void)
>>
>> mrt_cachep = kmem_cache_create("ip_mrt_cache",
>> sizeof(struct mfc_cache),
>> - 0, SLAB_HWCACHE_ALIGN | SLAB_PANIC,
>> + 0, SLAB_HWCACHE_ALIGN,
>> NULL);
>> if (!mrt_cachep)
>> return -ENOMEM;
>
> This runs at boot time.
>
> I very much prefer a panic instead of having to deal with a host with a
> probable bug in mm layer at this point.
>
Right, I was unsure about this one, I tried to rely on the ipmr_get_table() returning NULL but
I guess it's better to be safe than sorry.
I'll respin with the panic in place and removed null check.
> For IPv6, it is a different matter as it might be a module, thus
> ip6_mr_init() does not use SLAB_PANIC
Yep, I saw. It wasn't the reason I removed this one.
Thanks for the review!
next prev parent reply other threads:[~2015-11-21 14:27 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-21 13:01 [PATCH net-next 0/9] net: ipmr: cleanups and minor improvements Nikolay Aleksandrov
2015-11-21 13:01 ` [PATCH net-next 1/9] net: ipmr: move the tbl id check in ipmr_new_table Nikolay Aleksandrov
2015-11-21 13:01 ` [PATCH net-next 2/9] net: ipmr: always define mroute_reg_vif_num Nikolay Aleksandrov
2015-11-21 13:01 ` [PATCH net-next 3/9] net: ipmr: remove some pimsm ifdefs and simplify Nikolay Aleksandrov
2015-11-21 13:01 ` [PATCH net-next 4/9] net: ipmr: fix code and comment style Nikolay Aleksandrov
2015-11-21 13:01 ` [PATCH net-next 5/9] net: ipmr: make ip_mroute_getsockopt more understandable Nikolay Aleksandrov
2015-11-21 13:01 ` [PATCH net-next 6/9] net: ipmr: drop an instance of CONFIG_IP_MROUTE_MULTIPLE_TABLES Nikolay Aleksandrov
2015-11-21 13:01 ` [PATCH net-next 7/9] net: ipmr: remove SLAB_PANIC Nikolay Aleksandrov
2015-11-21 14:23 ` Eric Dumazet
2015-11-21 14:27 ` Nikolay Aleksandrov [this message]
2015-11-21 13:01 ` [PATCH net-next 8/9] net: ipmr: rearrange and cleanup setsockopt Nikolay Aleksandrov
2015-11-21 13:01 ` [PATCH net-next 9/9] net: ipmr: factor out common vif init code Nikolay Aleksandrov
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=56507F37.8070708@cumulusnetworks.com \
--to=nikolay@cumulusnetworks.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=razor@blackwall.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 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).