Skip to content

Commit ece3584

Browse files
Dongmao Zhangteigland
authored andcommitted
dlm: set zero linger time on sctp socket
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 <dmzhang@suse.com> Signed-off-by: David Teigland <teigland@redhat.com>
1 parent 374b105 commit ece3584

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎fs/dlm/lowcomms.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,7 @@ static void process_sctp_notification(struct connection *con,
649649
struct msghdr *msg, char *buf)
650650
{
651651
union sctp_notification *sn = (union sctp_notification *)buf;
652+
struct linger linger;
652653

653654
switch (sn->sn_header.sn_type) {
654655
case SCTP_SEND_FAILED:
@@ -727,6 +728,13 @@ static void process_sctp_notification(struct connection *con,
727728
}
728729
add_sock(new_con->sock, new_con);
729730

731+
linger.l_onoff = 1;
732+
linger.l_linger = 0;
733+
ret = kernel_setsockopt(new_con->sock, SOL_SOCKET, SO_LINGER,
734+
(char *)&linger, sizeof(linger));
735+
if (ret < 0)
736+
log_print("set socket option SO_LINGER failed");
737+
730738
log_print("connecting to %d sctp association %d",
731739
nodeid, (int)sn->sn_assoc_change.sac_assoc_id);
732740

0 commit comments

Comments
 (0)