Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 64021
b: refs/heads/master
c: 9e5f282
h: refs/heads/master
i:
  64019: 1e14a30
v: v3
  • Loading branch information
Patrick Caulfield authored and Steven Whitehouse committed Aug 14, 2007
1 parent 8d9add2 commit 31d5223
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 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: 1a2bf2eefb63a267aea7f3f80d6ac59160e20810
refs/heads/master: 9e5f2825a8b721360b291f14f42cd7a25781156b
25 changes: 15 additions & 10 deletions trunk/fs/dlm/lowcomms.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,15 +328,24 @@ static void close_connection(struct connection *con, bool and_other)
if (con->othercon && and_other) {
/* Will only re-enter once. */
close_connection(con->othercon, false);
kmem_cache_free(con_cache, con->othercon);
con->othercon = NULL;
}
if (con->rx_page) {
__free_page(con->rx_page);
con->rx_page = NULL;
}
con->retries = 0;
mutex_unlock(&con->sock_mutex);

/* If we are an 'othercon' then NULL the pointer to us
from the parent and tidy ourself up */
if (test_bit(CF_IS_OTHERCON, &con->flags)) {
struct connection *parent = __nodeid2con(con->nodeid, 0);
parent->othercon = NULL;
kmem_cache_free(con_cache, con);
}
else {
/* Parent connections get reused */
con->retries = 0;
mutex_unlock(&con->sock_mutex);
}
}

/* We only send shutdown messages to nodes that are not part of the cluster */
Expand Down Expand Up @@ -634,7 +643,7 @@ static int receive_from_sock(struct connection *con)

out_close:
mutex_unlock(&con->sock_mutex);
if (ret != -EAGAIN && !test_bit(CF_IS_OTHERCON, &con->flags)) {
if (ret != -EAGAIN) {
close_connection(con, false);
/* Reconnect when there is something to send */
}
Expand Down Expand Up @@ -1125,8 +1134,6 @@ static int tcp_listen_for_all(void)

log_print("Using TCP for communications");

set_bit(CF_IS_OTHERCON, &con->flags);

sock = tcp_create_listen_sock(con, dlm_local_addr[0]);
if (sock) {
add_sock(sock, con);
Expand Down Expand Up @@ -1410,7 +1417,7 @@ void dlm_lowcomms_stop(void)
for (i = 0; i <= max_nodeid; i++) {
con = __nodeid2con(i, 0);
if (con) {
con->flags |= 0xFF;
con->flags |= 0x0F;
if (con->sock)
con->sock->sk->sk_user_data = NULL;
}
Expand All @@ -1426,8 +1433,6 @@ void dlm_lowcomms_stop(void)
con = __nodeid2con(i, 0);
if (con) {
close_connection(con, true);
if (con->othercon)
kmem_cache_free(con_cache, con->othercon);
kmem_cache_free(con_cache, con);
}
}
Expand Down

0 comments on commit 31d5223

Please sign in to comment.