diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/dlm/lowcomms.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index a3350e4c8184..70736eb4b516 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c | |||
@@ -459,9 +459,9 @@ static void process_sctp_notification(struct connection *con, | |||
459 | int prim_len, ret; | 459 | int prim_len, ret; |
460 | int addr_len; | 460 | int addr_len; |
461 | struct connection *new_con; | 461 | struct connection *new_con; |
462 | struct file *file; | ||
463 | sctp_peeloff_arg_t parg; | 462 | sctp_peeloff_arg_t parg; |
464 | int parglen = sizeof(parg); | 463 | int parglen = sizeof(parg); |
464 | int err; | ||
465 | 465 | ||
466 | /* | 466 | /* |
467 | * We get this before any data for an association. | 467 | * We get this before any data for an association. |
@@ -516,19 +516,22 @@ static void process_sctp_notification(struct connection *con, | |||
516 | ret = kernel_getsockopt(con->sock, IPPROTO_SCTP, | 516 | ret = kernel_getsockopt(con->sock, IPPROTO_SCTP, |
517 | SCTP_SOCKOPT_PEELOFF, | 517 | SCTP_SOCKOPT_PEELOFF, |
518 | (void *)&parg, &parglen); | 518 | (void *)&parg, &parglen); |
519 | if (ret) { | 519 | if (ret < 0) { |
520 | log_print("Can't peel off a socket for " | 520 | log_print("Can't peel off a socket for " |
521 | "connection %d to node %d: err=%d\n", | 521 | "connection %d to node %d: err=%d", |
522 | parg.associd, nodeid, ret); | 522 | parg.associd, nodeid, ret); |
523 | return; | ||
524 | } | ||
525 | new_con->sock = sockfd_lookup(parg.sd, &err); | ||
526 | if (!new_con->sock) { | ||
527 | log_print("sockfd_lookup error %d", err); | ||
528 | return; | ||
523 | } | 529 | } |
524 | file = fget(parg.sd); | ||
525 | new_con->sock = SOCKET_I(file->f_dentry->d_inode); | ||
526 | add_sock(new_con->sock, new_con); | 530 | add_sock(new_con->sock, new_con); |
527 | fput(file); | 531 | sockfd_put(new_con->sock); |
528 | put_unused_fd(parg.sd); | ||
529 | 532 | ||
530 | log_print("got new/restarted association %d nodeid %d", | 533 | log_print("connecting to %d sctp association %d", |
531 | (int)sn->sn_assoc_change.sac_assoc_id, nodeid); | 534 | nodeid, (int)sn->sn_assoc_change.sac_assoc_id); |
532 | 535 | ||
533 | /* Send any pending writes */ | 536 | /* Send any pending writes */ |
534 | clear_bit(CF_CONNECT_PENDING, &new_con->flags); | 537 | clear_bit(CF_CONNECT_PENDING, &new_con->flags); |
@@ -841,8 +844,6 @@ static void sctp_init_assoc(struct connection *con) | |||
841 | if (con->retries++ > MAX_CONNECT_RETRIES) | 844 | if (con->retries++ > MAX_CONNECT_RETRIES) |
842 | return; | 845 | return; |
843 | 846 | ||
844 | log_print("Initiating association with node %d", con->nodeid); | ||
845 | |||
846 | if (nodeid_to_addr(con->nodeid, (struct sockaddr *)&rem_addr)) { | 847 | if (nodeid_to_addr(con->nodeid, (struct sockaddr *)&rem_addr)) { |
847 | log_print("no address for nodeid %d", con->nodeid); | 848 | log_print("no address for nodeid %d", con->nodeid); |
848 | return; | 849 | return; |