Skip to content

Commit

Permalink
dlm: set zero linger time on sctp socket
Browse files Browse the repository at this point in the history
The recovery time for a failed node was taking a long
time because the failed node could not perform the full
shutdown process.  Removing the linger time speeds this
up.  The dlm does not care what happens to messages to
or from the failed node.

Signed-off-by: Dongmao Zhang <[email protected]>
Signed-off-by: David Teigland <[email protected]>
  • Loading branch information
Dongmao Zhang authored and teigland committed Dec 16, 2013
1 parent 374b105 commit ece3584
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions fs/dlm/lowcomms.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit ece3584

Please sign in to comment.