From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net] net: rtnl_register in net_ns_init need rtnl_lock
Date: Thu, 22 Sep 2016 15:41:23 +0200 [thread overview]
Message-ID: <4c1b9aba-e6e8-babc-1bbe-aef2bc0bca53@stressinduktion.org> (raw)
In-Reply-To: <1474549384.23058.94.camel@edumazet-glaptop3.roam.corp.google.com>
On 22.09.2016 15:03, Eric Dumazet wrote:
> On Thu, 2016-09-22 at 13:03 +0200, Hannes Frederic Sowa wrote:
>> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
>> ---
>> net/core/net_namespace.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
>> index 2c2eb1b629b11d..a2ace299f28355 100644
>> --- a/net/core/net_namespace.c
>> +++ b/net/core/net_namespace.c
>> @@ -758,9 +758,11 @@ static int __init net_ns_init(void)
>>
>> register_pernet_subsys(&net_ns_ops);
>>
>> + rtnl_lock();
>> rtnl_register(PF_UNSPEC, RTM_NEWNSID, rtnl_net_newid, NULL, NULL);
>> rtnl_register(PF_UNSPEC, RTM_GETNSID, rtnl_net_getid, rtnl_net_dumpid,
>> NULL);
>> + rtnl_unlock();
>>
>> return 0;
>> }
>
> Hi Hannes
>
> Why is this needed here, and not in other places ?
I found this during working on the file and actually saw no live issues
(belonged to another series which I just split up).
I don't think it is a big issue but wanted the writes to the
rtnl_msg_handlers array to be strictly serialized. I was working on
adding this to other places, too. Maybe better for net-next even?
Theoretically we would need to add a memory barriers to make sure we
don't publish uninitialized memory into the array if concurrent readers
of the array want to find their function pointers.
> Hint : A changelog always help reviewers and future bug hunting.
I will add that to v2.
Thanks,
Hannes
next prev parent reply other threads:[~2016-09-22 13:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-22 11:03 [PATCH net] net: rtnl_register in net_ns_init need rtnl_lock Hannes Frederic Sowa
2016-09-22 13:03 ` Eric Dumazet
2016-09-22 13:41 ` Hannes Frederic Sowa [this message]
2016-09-22 14:48 ` Eric Dumazet
2016-09-22 17:20 ` Cong Wang
2016-09-22 19:02 ` Hannes Frederic Sowa
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=4c1b9aba-e6e8-babc-1bbe-aef2bc0bca53@stressinduktion.org \
--to=hannes@stressinduktion.org \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.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).