From: Ying Xue <ying.xue@windriver.com>
To: <davem@davemloft.net>, <ktkhai@virtuozzo.com>, <jon.maloy@ericsson.com>
Cc: <netdev@vger.kernel.org>, <syzkaller-bugs@googlegroups.com>,
<tipc-discussion@lists.sourceforge.net>
Subject: [PATCH net v4 3/7] tipc: Introduce __tipc_nl_bearer_enable
Date: Wed, 14 Feb 2018 13:38:00 +0800 [thread overview]
Message-ID: <1518586684-12307-4-git-send-email-ying.xue@windriver.com> (raw)
In-Reply-To: <1518586684-12307-1-git-send-email-ying.xue@windriver.com>
Introduce __tipc_nl_bearer_enable() which doesn't hold RTNL lock.
Signed-off-by: Ying Xue <ying.xue@windriver.com>
---
net/tipc/bearer.c | 17 ++++++++++-------
net/tipc/bearer.h | 1 +
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index 61b6625..faf8fa0 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -855,7 +855,7 @@ int tipc_nl_bearer_disable(struct sk_buff *skb, struct genl_info *info)
return err;
}
-int tipc_nl_bearer_enable(struct sk_buff *skb, struct genl_info *info)
+int __tipc_nl_bearer_enable(struct sk_buff *skb, struct genl_info *info)
{
int err;
char *bearer;
@@ -897,15 +897,18 @@ int tipc_nl_bearer_enable(struct sk_buff *skb, struct genl_info *info)
prio = nla_get_u32(props[TIPC_NLA_PROP_PRIO]);
}
+ return tipc_enable_bearer(net, bearer, domain, prio, attrs);
+}
+
+int tipc_nl_bearer_enable(struct sk_buff *skb, struct genl_info *info)
+{
+ int err;
+
rtnl_lock();
- err = tipc_enable_bearer(net, bearer, domain, prio, attrs);
- if (err) {
- rtnl_unlock();
- return err;
- }
+ err = __tipc_nl_bearer_enable(skb, info);
rtnl_unlock();
- return 0;
+ return err;
}
int tipc_nl_bearer_add(struct sk_buff *skb, struct genl_info *info)
diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h
index bcc6d5f..fc81150 100644
--- a/net/tipc/bearer.h
+++ b/net/tipc/bearer.h
@@ -190,6 +190,7 @@ extern struct tipc_media udp_media_info;
int tipc_nl_bearer_disable(struct sk_buff *skb, struct genl_info *info);
int __tipc_nl_bearer_disable(struct sk_buff *skb, struct genl_info *info);
int tipc_nl_bearer_enable(struct sk_buff *skb, struct genl_info *info);
+int __tipc_nl_bearer_enable(struct sk_buff *skb, struct genl_info *info);
int tipc_nl_bearer_dump(struct sk_buff *skb, struct netlink_callback *cb);
int tipc_nl_bearer_get(struct sk_buff *skb, struct genl_info *info);
int tipc_nl_bearer_set(struct sk_buff *skb, struct genl_info *info);
--
2.7.4
next prev parent reply other threads:[~2018-02-14 5:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-14 5:37 [PATCH net v4 0/7] tipc: Fix missing RTNL lock protection during setting link properties Ying Xue
2018-02-14 5:37 ` [PATCH net v4 1/7] tipc: Refactor __tipc_nl_compat_doit Ying Xue
2018-02-14 5:37 ` [PATCH net v4 2/7] tipc: Introduce __tipc_nl_bearer_disable Ying Xue
2018-02-14 5:38 ` Ying Xue [this message]
2018-02-14 5:38 ` [PATCH net v4 4/7] tipc: Introduce __tipc_nl_bearer_set Ying Xue
2018-02-14 5:38 ` [PATCH net v4 5/7] tipc: Introduce __tipc_nl_media_set Ying Xue
2018-02-14 5:38 ` [PATCH net v4 6/7] tipc: Introduce __tipc_nl_net_set Ying Xue
2018-02-14 5:38 ` [PATCH net v4 7/7] tipc: Fix missing RTNL lock protection during setting link properties Ying Xue
2018-02-14 10:16 ` Kirill Tkhai
2018-02-14 19:46 ` [PATCH net v4 0/7] " 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=1518586684-12307-4-git-send-email-ying.xue@windriver.com \
--to=ying.xue@windriver.com \
--cc=davem@davemloft.net \
--cc=jon.maloy@ericsson.com \
--cc=ktkhai@virtuozzo.com \
--cc=netdev@vger.kernel.org \
--cc=syzkaller-bugs@googlegroups.com \
--cc=tipc-discussion@lists.sourceforge.net \
/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).