diff options
author | Ying Xue <ying.xue@windriver.com> | 2014-05-05 08:56:12 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-05 17:26:44 -0400 |
commit | 9db9fdd1983eb960182d72f95d77b91b3a5173d0 (patch) | |
tree | 0c4d21174478529972f3b630f7b1daa6f018f134 /net/tipc/node_subscr.c | |
parent | 10f465c4966fbc8f50a59480d37a3451f6f3d564 (diff) |
tipc: avoid to asynchronously notify subscriptions
Postpone the actions of notifying subscriptions until after node lock
is released, avoiding to asynchronously execute registered handlers
when node is lost.
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/node_subscr.c')
-rw-r--r-- | net/tipc/node_subscr.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/net/tipc/node_subscr.c b/net/tipc/node_subscr.c index 8a7384c04add..7c59ab1d6ecb 100644 --- a/net/tipc/node_subscr.c +++ b/net/tipc/node_subscr.c @@ -81,14 +81,13 @@ void tipc_nodesub_unsubscribe(struct tipc_node_subscr *node_sub) * * Note: node is locked by caller */ -void tipc_nodesub_notify(struct tipc_node *node) +void tipc_nodesub_notify(struct list_head *nsub_list) { - struct tipc_node_subscr *ns; + struct tipc_node_subscr *ns, *safe; - list_for_each_entry(ns, &node->nsub, nodesub_list) { + list_for_each_entry_safe(ns, safe, nsub_list, nodesub_list) { if (ns->handle_node_down) { - tipc_k_signal((Handler)ns->handle_node_down, - (unsigned long)ns->usr_handle); + ns->handle_node_down(ns->usr_handle); ns->handle_node_down = NULL; } } |