aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/dlm/lowcomms.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 2b32f3c82feb..5c33233bc2d5 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -219,7 +219,7 @@ static struct connection *assoc2con(int assoc_id)
219 struct connection *con; 219 struct connection *con;
220 220
221 down(&connections_lock); 221 down(&connections_lock);
222 for (i=0; i<max_nodeid; i++) { 222 for (i=0; i<=max_nodeid; i++) {
223 con = __nodeid2con(i, 0); 223 con = __nodeid2con(i, 0);
224 if (con && con->sctp_assoc == assoc_id) { 224 if (con && con->sctp_assoc == assoc_id) {
225 up(&connections_lock); 225 up(&connections_lock);
@@ -467,12 +467,10 @@ static void process_sctp_notification(struct connection *con, struct msghdr *msg
467 parg.associd = sn->sn_assoc_change.sac_assoc_id; 467 parg.associd = sn->sn_assoc_change.sac_assoc_id;
468 ret = kernel_getsockopt(con->sock, IPPROTO_SCTP, SCTP_SOCKOPT_PEELOFF, 468 ret = kernel_getsockopt(con->sock, IPPROTO_SCTP, SCTP_SOCKOPT_PEELOFF,
469 (void *)&parg, &parglen); 469 (void *)&parg, &parglen);
470 if (ret < 0) { 470 if (ret) {
471 log_print("Can't peel off a socket for connection %d to node %d: err=%d\n", 471 log_print("Can't peel off a socket for connection %d to node %d: err=%d\n",
472 parg.associd, nodeid, ret); 472 parg.associd, nodeid, ret);
473 return;
474 } 473 }
475
476 file = fget(parg.sd); 474 file = fget(parg.sd);
477 new_con->sock = SOCKET_I(file->f_dentry->d_inode); 475 new_con->sock = SOCKET_I(file->f_dentry->d_inode);
478 add_sock(new_con->sock, new_con); 476 add_sock(new_con->sock, new_con);
@@ -585,7 +583,6 @@ static int receive_from_sock(struct connection *con)
585 583
586 /* Process SCTP notifications */ 584 /* Process SCTP notifications */
587 if (msg.msg_flags & MSG_NOTIFICATION) { 585 if (msg.msg_flags & MSG_NOTIFICATION) {
588 BUG_ON(con->nodeid != 0);
589 msg.msg_control = incmsg; 586 msg.msg_control = incmsg;
590 msg.msg_controllen = sizeof(incmsg); 587 msg.msg_controllen = sizeof(incmsg);
591 588
@@ -984,6 +981,7 @@ static void init_local(void)
984 struct sockaddr_storage sas, *addr; 981 struct sockaddr_storage sas, *addr;
985 int i; 982 int i;
986 983
984 dlm_local_count = 0;
987 for (i = 0; i < DLM_MAX_ADDR_COUNT - 1; i++) { 985 for (i = 0; i < DLM_MAX_ADDR_COUNT - 1; i++) {
988 if (dlm_our_addr(&sas, i)) 986 if (dlm_our_addr(&sas, i))
989 break; 987 break;
@@ -1350,8 +1348,8 @@ static void clean_writequeues(void)
1350{ 1348{
1351 int nodeid; 1349 int nodeid;
1352 1350
1353 for (nodeid = 1; nodeid < max_nodeid; nodeid++) { 1351 for (nodeid = 1; nodeid <= max_nodeid; nodeid++) {
1354 struct connection *con = nodeid2con(nodeid, 0); 1352 struct connection *con = __nodeid2con(nodeid, 0);
1355 1353
1356 if (con) 1354 if (con)
1357 clean_one_writequeue(con); 1355 clean_one_writequeue(con);
@@ -1394,7 +1392,7 @@ void dlm_lowcomms_stop(void)
1394 socket activity. 1392 socket activity.
1395 */ 1393 */
1396 down(&connections_lock); 1394 down(&connections_lock);
1397 for (i = 0; i < max_nodeid; i++) { 1395 for (i = 0; i <= max_nodeid; i++) {
1398 con = __nodeid2con(i, 0); 1396 con = __nodeid2con(i, 0);
1399 if (con) 1397 if (con)
1400 con->flags |= 0xFF; 1398 con->flags |= 0xFF;
@@ -1406,7 +1404,7 @@ void dlm_lowcomms_stop(void)
1406 down(&connections_lock); 1404 down(&connections_lock);
1407 clean_writequeues(); 1405 clean_writequeues();
1408 1406
1409 for (i = 0; i < max_nodeid; i++) { 1407 for (i = 0; i <= max_nodeid; i++) {
1410 con = __nodeid2con(i, 0); 1408 con = __nodeid2con(i, 0);
1411 if (con) { 1409 if (con) {
1412 close_connection(con, true); 1410 close_connection(con, true);
@@ -1415,8 +1413,10 @@ void dlm_lowcomms_stop(void)
1415 kmem_cache_free(con_cache, con); 1413 kmem_cache_free(con_cache, con);
1416 } 1414 }
1417 } 1415 }
1416 max_nodeid = 0;
1418 up(&connections_lock); 1417 up(&connections_lock);
1419 kmem_cache_destroy(con_cache); 1418 kmem_cache_destroy(con_cache);
1419 idr_init(&connections_idr);
1420} 1420}
1421 1421
1422int dlm_lowcomms_start(void) 1422int dlm_lowcomms_start(void)