aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/node.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r--net/tipc/node.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c
index 2b0a0849d4cc..befbcc9eade6 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -321,10 +321,10 @@ static void node_lost_contact(struct tipc_node *n_ptr)
321 } 321 }
322 322
323 /* Notify subscribers */ 323 /* Notify subscribers */
324 tipc_nodesub_notify(n_ptr); 324 n_ptr->flags = TIPC_NODE_LOST;
325 325
326 /* Prevent re-contact with node until cleanup is done */ 326 /* Prevent re-contact with node until cleanup is done */
327 n_ptr->flags = TIPC_NODE_DOWN | TIPC_NAMES_GONE; 327 n_ptr->flags |= TIPC_NODE_DOWN | TIPC_NAMES_GONE;
328 tipc_k_signal((Handler)node_name_purge_complete, n_ptr->addr); 328 tipc_k_signal((Handler)node_name_purge_complete, n_ptr->addr);
329} 329}
330 330
@@ -465,3 +465,22 @@ int tipc_node_get_linkname(u32 bearer_id, u32 addr, char *linkname, size_t len)
465 tipc_node_unlock(node); 465 tipc_node_unlock(node);
466 return -EINVAL; 466 return -EINVAL;
467} 467}
468
469void tipc_node_unlock(struct tipc_node *node)
470{
471 LIST_HEAD(nsub_list);
472
473 if (likely(!node->flags)) {
474 spin_unlock_bh(&node->lock);
475 return;
476 }
477
478 if (node->flags & TIPC_NODE_LOST) {
479 list_replace_init(&node->nsub, &nsub_list);
480 node->flags &= ~TIPC_NODE_LOST;
481 }
482 spin_unlock_bh(&node->lock);
483
484 if (!list_empty(&nsub_list))
485 tipc_nodesub_notify(&nsub_list);
486}