From: Kirill Tkhai <ktkhai@virtuozzo.com>
To: davem@davemloft.net, ktkhai@virtuozzo.com, vyasevic@redhat.com,
edumazet@google.com, nicolas.dichtel@6wind.com,
netdev@vger.kernel.org
Subject: [PATCH net-next 2/2] net: Use rtnl_lock_killable() in register_netdev()
Date: Wed, 14 Mar 2018 22:17:28 +0300 [thread overview]
Message-ID: <152105504831.24797.8372021805674601073.stgit@localhost.localdomain> (raw)
In-Reply-To: <152105492788.24797.10467675660981296096.stgit@localhost.localdomain>
This patch adds rtnl_lock_killable() to one of hot path
using rtnl_lock().
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
net/core/dev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 12a9aad0b057..d8887cc38e7b 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -8018,7 +8018,8 @@ int register_netdev(struct net_device *dev)
{
int err;
- rtnl_lock();
+ if (rtnl_lock_killable())
+ return -EINTR;
err = register_netdevice(dev);
rtnl_unlock();
return err;
next prev parent reply other threads:[~2018-03-14 19:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-14 19:17 [PATCH net-next 0/2] Introduce rtnl_lock_killable() Kirill Tkhai
2018-03-14 19:17 ` [PATCH net-next 1/2] net: Add rtnl_lock_killable() Kirill Tkhai
2018-03-14 19:17 ` Kirill Tkhai [this message]
2018-03-16 16:31 ` [PATCH net-next 0/2] Introduce rtnl_lock_killable() 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=152105504831.24797.8372021805674601073.stgit@localhost.localdomain \
--to=ktkhai@virtuozzo.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--cc=vyasevic@redhat.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