Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213830
b: refs/heads/master
c: 5a68d5e
h: refs/heads/master
v: v3
  • Loading branch information
Allan Stephens authored and David S. Miller committed Aug 18, 2010
1 parent 78c23ab commit 289980f
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 564e83b51a12b794e3f63a2d872398e1ee21616f
refs/heads/master: 5a68d5ee000bb784c4856391b4861739c8bbd341
8 changes: 8 additions & 0 deletions trunk/net/tipc/discover.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,14 @@ void tipc_disc_recv_msg(struct sk_buff *buf, struct bearer *b_ptr)
return;
}
spin_lock_bh(&n_ptr->lock);

/* Don't talk to neighbor during cleanup after last session */

if (n_ptr->cleanup_required) {
spin_unlock_bh(&n_ptr->lock);
return;
}

link = n_ptr->links[b_ptr->identity];
if (!link) {
dbg("creating link\n");
Expand Down
11 changes: 10 additions & 1 deletion trunk/net/tipc/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -1869,13 +1869,22 @@ void tipc_recv_msg(struct sk_buff *head, struct tipc_bearer *tb_ptr)
goto cont;
}

/* Locate unicast link endpoint that should handle message */
/* Locate neighboring node that sent message */

n_ptr = tipc_node_find(msg_prevnode(msg));
if (unlikely(!n_ptr))
goto cont;
tipc_node_lock(n_ptr);

/* Don't talk to neighbor during cleanup after last session */

if (n_ptr->cleanup_required) {
tipc_node_unlock(n_ptr);
goto cont;
}

/* Locate unicast link endpoint that should handle message */

l_ptr = n_ptr->links[b_ptr->identity];
if (unlikely(!l_ptr)) {
tipc_node_unlock(n_ptr);
Expand Down
19 changes: 19 additions & 0 deletions trunk/net/tipc/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,20 @@ static void node_established_contact(struct tipc_node *n_ptr)
tipc_highest_allowed_slave);
}

static void node_cleanup_finished(unsigned long node_addr)
{
struct tipc_node *n_ptr;

read_lock_bh(&tipc_net_lock);
n_ptr = tipc_node_find(node_addr);
if (n_ptr) {
tipc_node_lock(n_ptr);
n_ptr->cleanup_required = 0;
tipc_node_unlock(n_ptr);
}
read_unlock_bh(&tipc_net_lock);
}

static void node_lost_contact(struct tipc_node *n_ptr)
{
struct cluster *c_ptr;
Expand Down Expand Up @@ -457,6 +471,11 @@ static void node_lost_contact(struct tipc_node *n_ptr)
tipc_k_signal((Handler)ns->handle_node_down,
(unsigned long)ns->usr_handle);
}

/* Prevent re-contact with node until all cleanup is done */

n_ptr->cleanup_required = 1;
tipc_k_signal((Handler)node_cleanup_finished, n_ptr->addr);
}

/**
Expand Down
2 changes: 2 additions & 0 deletions trunk/net/tipc/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
* @active_links: pointers to active links to node
* @links: pointers to all links to node
* @working_links: number of working links to node (both active and standby)
* @cleanup_required: non-zero if cleaning up after a prior loss of contact
* @link_cnt: number of links to node
* @permit_changeover: non-zero if node has redundant links to this system
* @routers: bitmap (used for multicluster communication)
Expand All @@ -78,6 +79,7 @@ struct tipc_node {
struct link *links[MAX_BEARERS];
int link_cnt;
int working_links;
int cleanup_required;
int permit_changeover;
u32 routers[512/32];
int last_router;
Expand Down

0 comments on commit 289980f

Please sign in to comment.