diff options
Diffstat (limited to 'fs/dlm/lowcomms.c')
-rw-r--r-- | fs/dlm/lowcomms.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index 58bf3f5cdbe2..7c1e5e5cccd8 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c | |||
@@ -864,7 +864,7 @@ static void sctp_init_assoc(struct connection *con) | |||
864 | static void tcp_connect_to_sock(struct connection *con) | 864 | static void tcp_connect_to_sock(struct connection *con) |
865 | { | 865 | { |
866 | int result = -EHOSTUNREACH; | 866 | int result = -EHOSTUNREACH; |
867 | struct sockaddr_storage saddr; | 867 | struct sockaddr_storage saddr, src_addr; |
868 | int addr_len; | 868 | int addr_len; |
869 | struct socket *sock; | 869 | struct socket *sock; |
870 | 870 | ||
@@ -898,6 +898,17 @@ static void tcp_connect_to_sock(struct connection *con) | |||
898 | con->connect_action = tcp_connect_to_sock; | 898 | con->connect_action = tcp_connect_to_sock; |
899 | add_sock(sock, con); | 899 | add_sock(sock, con); |
900 | 900 | ||
901 | /* Bind to our cluster-known address connecting to avoid | ||
902 | routing problems */ | ||
903 | memcpy(&src_addr, dlm_local_addr[0], sizeof(src_addr)); | ||
904 | make_sockaddr(&src_addr, 0, &addr_len); | ||
905 | result = sock->ops->bind(sock, (struct sockaddr *) &src_addr, | ||
906 | addr_len); | ||
907 | if (result < 0) { | ||
908 | log_print("could not bind for connect: %d", result); | ||
909 | /* This *may* not indicate a critical error */ | ||
910 | } | ||
911 | |||
901 | make_sockaddr(&saddr, dlm_config.ci_tcp_port, &addr_len); | 912 | make_sockaddr(&saddr, dlm_config.ci_tcp_port, &addr_len); |
902 | 913 | ||
903 | log_print("connecting to %d", con->nodeid); | 914 | log_print("connecting to %d", con->nodeid); |
@@ -1062,7 +1073,7 @@ static int sctp_listen_for_all(void) | |||
1062 | subscribe.sctp_shutdown_event = 1; | 1073 | subscribe.sctp_shutdown_event = 1; |
1063 | subscribe.sctp_partial_delivery_event = 1; | 1074 | subscribe.sctp_partial_delivery_event = 1; |
1064 | 1075 | ||
1065 | result = kernel_setsockopt(sock, SOL_SOCKET, SO_RCVBUF, | 1076 | result = kernel_setsockopt(sock, SOL_SOCKET, SO_RCVBUFFORCE, |
1066 | (char *)&bufsize, sizeof(bufsize)); | 1077 | (char *)&bufsize, sizeof(bufsize)); |
1067 | if (result) | 1078 | if (result) |
1068 | log_print("Error increasing buffer space on socket %d", result); | 1079 | log_print("Error increasing buffer space on socket %d", result); |
@@ -1426,6 +1437,8 @@ void dlm_lowcomms_stop(void) | |||
1426 | con = __nodeid2con(i, 0); | 1437 | con = __nodeid2con(i, 0); |
1427 | if (con) { | 1438 | if (con) { |
1428 | close_connection(con, true); | 1439 | close_connection(con, true); |
1440 | if (con->othercon) | ||
1441 | kmem_cache_free(con_cache, con->othercon); | ||
1429 | kmem_cache_free(con_cache, con); | 1442 | kmem_cache_free(con_cache, con); |
1430 | } | 1443 | } |
1431 | } | 1444 | } |
@@ -1454,10 +1467,6 @@ int dlm_lowcomms_start(void) | |||
1454 | if (!con_cache) | 1467 | if (!con_cache) |
1455 | goto out; | 1468 | goto out; |
1456 | 1469 | ||
1457 | /* Set some sysctl minima */ | ||
1458 | if (sysctl_rmem_max < NEEDED_RMEM) | ||
1459 | sysctl_rmem_max = NEEDED_RMEM; | ||
1460 | |||
1461 | /* Start listening */ | 1470 | /* Start listening */ |
1462 | if (dlm_config.ci_protocol == 0) | 1471 | if (dlm_config.ci_protocol == 0) |
1463 | error = tcp_listen_for_all(); | 1472 | error = tcp_listen_for_all(); |