public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Kirill Tkhai <ktkhai@virtuozzo.com>
To: davem@davemloft.net, zhangshengju@cmss.chinamobile.com,
	ktkhai@virtuozzo.com, jakub.kicinski@netronome.com,
	dsahern@gmail.com, mschiffer@universe-factory.net,
	daniel@iogearbox.net, netdev@vger.kernel.org
Subject: [PATCH RESEND net-next 0/2] net_rwsem fixes
Date: Fri, 30 Mar 2018 19:38:16 +0300	[thread overview]
Message-ID: <152242784495.18864.4373352355749698367.stgit@localhost.localdomain> (raw)

(Forgot to CC netdev@ :)

Hi,

there is wext_netdev_notifier_call()->wireless_nlevent_flush()
netdevice notifier, which takes net_rwsem, so we can't take
net_rwsem in {,un}register_netdevice_notifier().

Since {,un}register_netdevice_notifier() is executed under
pernet_ops_rwsem, net_namespace_list can't change, while we
holding it, so there is no need net_rwsem in these functions [1/2].

The same is in [2/2]. We make callers of __rtnl_link_unregister()
take pernet_ops_rwsem, and close the race with setup_net()
and cleanup_net(), so __rtnl_link_unregister() does not need it.
This also fixes the problem of that __rtnl_link_unregister() does
not see initializing and exiting nets.

Thanks,
Kirill
---

Kirill Tkhai (2):
      net: Remove net_rwsem from {,un}register_netdevice_notifier()
      net: Do not take net_rwsem in __rtnl_link_unregister()


 drivers/net/dummy.c      |    2 ++
 drivers/net/ifb.c        |    2 ++
 net/core/dev.c           |    5 -----
 net/core/net_namespace.c |    1 +
 net/core/rtnetlink.c     |    6 +++---
 5 files changed, 8 insertions(+), 8 deletions(-)

             reply	other threads:[~2018-03-30 16:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-30 16:38 Kirill Tkhai [this message]
2018-03-30 16:38 ` [PATCH RESEND net-next 1/2] net: Remove net_rwsem from {, un}register_netdevice_notifier() Kirill Tkhai
2018-03-30 16:38 ` [PATCH RESEND net-next 2/2] net: Do not take net_rwsem in __rtnl_link_unregister() Kirill Tkhai
2018-04-01  2:25 ` [PATCH RESEND net-next 0/2] net_rwsem fixes David Miller

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=152242784495.18864.4373352355749698367.stgit@localhost.localdomain \
    --to=ktkhai@virtuozzo.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=jakub.kicinski@netronome.com \
    --cc=mschiffer@universe-factory.net \
    --cc=netdev@vger.kernel.org \
    --cc=zhangshengju@cmss.chinamobile.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