dlm for 4.18
These three commits fix and clean up the flags dlm was using on its SCTP sockets. The result improves the performance and fixes some bad connection delays. -----BEGIN PGP SIGNATURE----- iQIcBAABAgAGBQJbFXmBAAoJEDgbc8f8gGmqDYsP/12AlXOdUJmhyK3/GwYGmayx +mnUkQ/PacfsjXIFt1HHCM9LcSCk9gTES8suoFHkP5wfMMqKz6VoVG6k2sXn2jMS Ig+xCCFsTIR1n8ZB7ZAhQFkYgOGsKujDgLQ/7dYBos331zdZSD8CqTYTcti5twdE C4uERBR2RLDHGTzgAVEWSE/wc3QK8Yw8O9Yh1tebBFRyMU/tQl53HlviMozhJGlZ vg6Mm8eVE9OSUBRp4LzG34xYj7YD05j5cJBkQWVjTlg+giNCZnlLWQOv0rbiy2+M IXf/TmYKqbtdc4ATMrJStIdJSjErZeuDtWvKEtpaW/w2TjiwOTS56KG/W4kC4Wjs 5MuHVFI3jRmgrL1iCwIotqu+BkE1dlHP81DbLKRy53lvit+zEWoh3G1V9rUSGDcd tEs36BwJERpmiTw2roOzajdLyi6Z2Jlv/GJCXUyQ2YXBV8WvTKeQbb+VSc6rCz1E WBZ/vOIbA8JibXVuMHw6iPwy99M5lk/6q8Sa1CS9GiYmGfM3fDesKpYGnKIu77AH 4pnm6OgPihU+dZratHIJMddNAyorkcaYuOq0TkLiTJZas/MpGKuKHncEARUfcHno e1RSz1yPuN0OEJoVJBiWfe8nSAV/6vXvEPlWTMfwADfpXTYxTphqRW3VvC4N1Cpi gNiAKXvdIjRpGjInPeI3 =jiYf -----END PGP SIGNATURE----- Merge tag 'dlm-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm Pull dlm updates from David Teigland: "These three commits fix and clean up the flags dlm was using on its SCTP sockets. This improves performance and fixes some bad connection delays" * tag 'dlm-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm: dlm: remove O_NONBLOCK flag in sctp_connect_to_sock dlm: make sctp_connect_to_sock() return in specified time dlm: fix a clerical error when set SCTP_NODELAY
This commit is contained in:
commit
8a4631144b
|
@ -1037,6 +1037,7 @@ static void sctp_connect_to_sock(struct connection *con)
|
|||
int result;
|
||||
int addr_len;
|
||||
struct socket *sock;
|
||||
struct timeval tv = { .tv_sec = 5, .tv_usec = 0 };
|
||||
|
||||
if (con->nodeid == 0) {
|
||||
log_print("attempt to connect sock 0 foiled");
|
||||
|
@ -1080,11 +1081,22 @@ static void sctp_connect_to_sock(struct connection *con)
|
|||
log_print("connecting to %d", con->nodeid);
|
||||
|
||||
/* Turn off Nagle's algorithm */
|
||||
kernel_setsockopt(sock, SOL_TCP, TCP_NODELAY, (char *)&one,
|
||||
kernel_setsockopt(sock, SOL_SCTP, SCTP_NODELAY, (char *)&one,
|
||||
sizeof(one));
|
||||
|
||||
/*
|
||||
* Make sock->ops->connect() function return in specified time,
|
||||
* since O_NONBLOCK argument in connect() function does not work here,
|
||||
* then, we should restore the default value of this attribute.
|
||||
*/
|
||||
kernel_setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (char *)&tv,
|
||||
sizeof(tv));
|
||||
result = sock->ops->connect(sock, (struct sockaddr *)&daddr, addr_len,
|
||||
O_NONBLOCK);
|
||||
0);
|
||||
memset(&tv, 0, sizeof(tv));
|
||||
kernel_setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (char *)&tv,
|
||||
sizeof(tv));
|
||||
|
||||
if (result == -EINPROGRESS)
|
||||
result = 0;
|
||||
if (result == 0)
|
||||
|
|
Loading…
Reference in New Issue