diff options
author | David S. Miller <davem@davemloft.net> | 2015-02-04 16:09:38 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-02-04 16:09:38 -0800 |
commit | 251c005a6403933b3405fdc15fca4355e7590b42 (patch) | |
tree | 9804ac41fbf6758b52ebec7c981a714d9d9199bd /net/tipc/node.c | |
parent | 940288b6a560710d4c63bc84d9570779dd7dec2b (diff) | |
parent | af9946fde9983e1312e5bcda7d1658fee2a3cb1d (diff) |
Merge branch 'tipc-next'
Jon Maloy says:
====================
tipc: some small fixes
During extensive testing and analysis of running dual links between
nodes, we have encountered some issues that potentially may cause
problems. We choose to fix those proactively in this series.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r-- | net/tipc/node.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c index ee5d33cfcf8..842bd7ad4b1 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c @@ -96,14 +96,14 @@ struct tipc_node *tipc_node_create(struct net *net, u32 addr) struct tipc_node *n_ptr, *temp_node; spin_lock_bh(&tn->node_list_lock); - + n_ptr = tipc_node_find(net, addr); + if (n_ptr) + goto exit; n_ptr = kzalloc(sizeof(*n_ptr), GFP_ATOMIC); if (!n_ptr) { - spin_unlock_bh(&tn->node_list_lock); pr_warn("Node creation failed, no memory\n"); - return NULL; + goto exit; } - n_ptr->addr = addr; n_ptr->net = net; spin_lock_init(&n_ptr->lock); @@ -123,9 +123,8 @@ struct tipc_node *tipc_node_create(struct net *net, u32 addr) list_add_tail_rcu(&n_ptr->list, &temp_node->list); n_ptr->action_flags = TIPC_WAIT_PEER_LINKS_DOWN; n_ptr->signature = INVALID_NODE_SIG; - tn->num_nodes++; - +exit: spin_unlock_bh(&tn->node_list_lock); return n_ptr; } @@ -406,6 +405,10 @@ static void node_lost_contact(struct tipc_node *n_ptr) l_ptr->reset_checkpoint = l_ptr->next_in_no; l_ptr->exp_msg_count = 0; tipc_link_reset_fragments(l_ptr); + + /* Link marked for deletion after failover? => do it now */ + if (l_ptr->flags & LINK_STOPPED) + tipc_link_delete(l_ptr); } n_ptr->action_flags &= ~TIPC_WAIT_OWN_LINKS_DOWN; |