Commit 5631f65d authored by Ying Xue's avatar Ying Xue Committed by David S. Miller

tipc: Introduce __tipc_nl_net_set

Introduce __tipc_nl_net_set() which doesn't hold RTNL lock.
Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 07ffb223
...@@ -200,7 +200,7 @@ int tipc_nl_net_dump(struct sk_buff *skb, struct netlink_callback *cb) ...@@ -200,7 +200,7 @@ int tipc_nl_net_dump(struct sk_buff *skb, struct netlink_callback *cb)
return skb->len; return skb->len;
} }
int tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info) int __tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info)
{ {
struct net *net = sock_net(skb->sk); struct net *net = sock_net(skb->sk);
struct tipc_net *tn = net_generic(net, tipc_net_id); struct tipc_net *tn = net_generic(net, tipc_net_id);
...@@ -241,10 +241,19 @@ int tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info) ...@@ -241,10 +241,19 @@ int tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info)
if (!tipc_addr_node_valid(addr)) if (!tipc_addr_node_valid(addr))
return -EINVAL; return -EINVAL;
rtnl_lock();
tipc_net_start(net, addr); tipc_net_start(net, addr);
rtnl_unlock();
} }
return 0; return 0;
} }
int tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info)
{
int err;
rtnl_lock();
err = __tipc_nl_net_set(skb, info);
rtnl_unlock();
return err;
}
...@@ -47,5 +47,6 @@ void tipc_net_stop(struct net *net); ...@@ -47,5 +47,6 @@ void tipc_net_stop(struct net *net);
int tipc_nl_net_dump(struct sk_buff *skb, struct netlink_callback *cb); int tipc_nl_net_dump(struct sk_buff *skb, struct netlink_callback *cb);
int tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info); int tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info);
int __tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment