Commit efa172f4 authored by WANG Cong's avatar WANG Cong Committed by David S. Miller

netlink: use blocking notifier

netlink_chain is called in ->release(), which is apparently
a process context, so we don't have to use an atomic notifier
here.
Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 821781a9
...@@ -113,7 +113,7 @@ static atomic_t nl_table_users = ATOMIC_INIT(0); ...@@ -113,7 +113,7 @@ static atomic_t nl_table_users = ATOMIC_INIT(0);
#define nl_deref_protected(X) rcu_dereference_protected(X, lockdep_is_held(&nl_table_lock)); #define nl_deref_protected(X) rcu_dereference_protected(X, lockdep_is_held(&nl_table_lock));
static ATOMIC_NOTIFIER_HEAD(netlink_chain); static BLOCKING_NOTIFIER_HEAD(netlink_chain);
static DEFINE_SPINLOCK(netlink_tap_lock); static DEFINE_SPINLOCK(netlink_tap_lock);
static struct list_head netlink_tap_all __read_mostly; static struct list_head netlink_tap_all __read_mostly;
...@@ -711,7 +711,7 @@ static int netlink_release(struct socket *sock) ...@@ -711,7 +711,7 @@ static int netlink_release(struct socket *sock)
.protocol = sk->sk_protocol, .protocol = sk->sk_protocol,
.portid = nlk->portid, .portid = nlk->portid,
}; };
atomic_notifier_call_chain(&netlink_chain, blocking_notifier_call_chain(&netlink_chain,
NETLINK_URELEASE, &n); NETLINK_URELEASE, &n);
} }
...@@ -2504,13 +2504,13 @@ static const struct file_operations netlink_seq_fops = { ...@@ -2504,13 +2504,13 @@ static const struct file_operations netlink_seq_fops = {
int netlink_register_notifier(struct notifier_block *nb) int netlink_register_notifier(struct notifier_block *nb)
{ {
return atomic_notifier_chain_register(&netlink_chain, nb); return blocking_notifier_chain_register(&netlink_chain, nb);
} }
EXPORT_SYMBOL(netlink_register_notifier); EXPORT_SYMBOL(netlink_register_notifier);
int netlink_unregister_notifier(struct notifier_block *nb) int netlink_unregister_notifier(struct notifier_block *nb)
{ {
return atomic_notifier_chain_unregister(&netlink_chain, nb); return blocking_notifier_chain_unregister(&netlink_chain, nb);
} }
EXPORT_SYMBOL(netlink_unregister_notifier); EXPORT_SYMBOL(netlink_unregister_notifier);
......
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