aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/node.c
diff options
context:
space:
mode:
authorYing Xue <ying.xue@windriver.com>2014-05-04 20:56:14 -0400
committerDavid S. Miller <davem@davemloft.net>2014-05-05 17:26:44 -0400
commitca0c42732c512a12fabe677594840f31861dd31a (patch)
tree80f703e28c77128d77006e47b9e6a9c8735fb5df /net/tipc/node.c
parent9d561949685749be3d97239eab7d85aa78718108 (diff)
tipc: avoid to asynchronously deliver name tables to peer node
Postpone the actions of delivering name tables until after node lock is released, avoiding to do it under asynchronous context. 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.c')
-rw-r--r--net/tipc/node.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c
index c3a36bba9952..74efebc1cb7a 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -267,7 +267,7 @@ void tipc_node_detach_link(struct tipc_node *n_ptr, struct tipc_link *l_ptr)
267 267
268static void node_established_contact(struct tipc_node *n_ptr) 268static void node_established_contact(struct tipc_node *n_ptr)
269{ 269{
270 tipc_k_signal((Handler)tipc_named_node_up, n_ptr->addr); 270 n_ptr->flags |= TIPC_NODE_UP;
271 n_ptr->bclink.oos_state = 0; 271 n_ptr->bclink.oos_state = 0;
272 n_ptr->bclink.acked = tipc_bclink_get_last_sent(); 272 n_ptr->bclink.acked = tipc_bclink_get_last_sent();
273 tipc_bclink_add_node(n_ptr->addr); 273 tipc_bclink_add_node(n_ptr->addr);
@@ -455,6 +455,9 @@ int tipc_node_get_linkname(u32 bearer_id, u32 addr, char *linkname, size_t len)
455void tipc_node_unlock(struct tipc_node *node) 455void tipc_node_unlock(struct tipc_node *node)
456{ 456{
457 LIST_HEAD(nsub_list); 457 LIST_HEAD(nsub_list);
458 struct tipc_link *link;
459 int pkt_sz = 0;
460 u32 addr = 0;
458 461
459 if (likely(!node->flags)) { 462 if (likely(!node->flags)) {
460 spin_unlock_bh(&node->lock); 463 spin_unlock_bh(&node->lock);
@@ -465,8 +468,19 @@ void tipc_node_unlock(struct tipc_node *node)
465 list_replace_init(&node->nsub, &nsub_list); 468 list_replace_init(&node->nsub, &nsub_list);
466 node->flags &= ~TIPC_NODE_LOST; 469 node->flags &= ~TIPC_NODE_LOST;
467 } 470 }
471 if (node->flags & TIPC_NODE_UP) {
472 link = node->active_links[0];
473 node->flags &= ~TIPC_NODE_UP;
474 if (link) {
475 pkt_sz = ((link->max_pkt - INT_H_SIZE) / ITEM_SIZE) *
476 ITEM_SIZE;
477 addr = node->addr;
478 }
479 }
468 spin_unlock_bh(&node->lock); 480 spin_unlock_bh(&node->lock);
469 481
470 if (!list_empty(&nsub_list)) 482 if (!list_empty(&nsub_list))
471 tipc_nodesub_notify(&nsub_list); 483 tipc_nodesub_notify(&nsub_list);
484 if (pkt_sz)
485 tipc_named_node_up(pkt_sz, addr);
472} 486}