]> Pileus Git - ~andy/linux/blobdiff - fs/dlm/lowcomms.c
Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
[~andy/linux] / fs / dlm / lowcomms.c
index d90909ec6aa6bc5dd846b0545773b8cee0bee7d8..3190ca973dd6be657a50b3cd8ff0f34b06a40fb1 100644 (file)
@@ -649,6 +649,7 @@ static void process_sctp_notification(struct connection *con,
                                      struct msghdr *msg, char *buf)
 {
        union sctp_notification *sn = (union sctp_notification *)buf;
+       struct linger linger;
 
        switch (sn->sn_header.sn_type) {
        case SCTP_SEND_FAILED:
@@ -713,11 +714,11 @@ static void process_sctp_notification(struct connection *con,
                                return;
 
                        /* Peel off a new sock */
-                       sctp_lock_sock(con->sock->sk);
+                       lock_sock(con->sock->sk);
                        ret = sctp_do_peeloff(con->sock->sk,
                                sn->sn_assoc_change.sac_assoc_id,
                                &new_con->sock);
-                       sctp_release_sock(con->sock->sk);
+                       release_sock(con->sock->sk);
                        if (ret < 0) {
                                log_print("Can't peel off a socket for "
                                          "connection %d to node %d: err=%d",
@@ -727,6 +728,13 @@ static void process_sctp_notification(struct connection *con,
                        }
                        add_sock(new_con->sock, new_con);
 
+                       linger.l_onoff = 1;
+                       linger.l_linger = 0;
+                       ret = kernel_setsockopt(new_con->sock, SOL_SOCKET, SO_LINGER,
+                                               (char *)&linger, sizeof(linger));
+                       if (ret < 0)
+                               log_print("set socket option SO_LINGER failed");
+
                        log_print("connecting to %d sctp association %d",
                                 nodeid, (int)sn->sn_assoc_change.sac_assoc_id);