Skip to content

Commit 7a2f6f7

Browse files
bcodding-rhAnna Schumaker
authored andcommitted
SUNRPC: Handle -ETIMEDOUT return from tlshd
If the TLS handshake attempt returns -ETIMEDOUT, we currently translate that error into -EACCES. This becomes problematic for cases where the RPC layer is attempting to re-connect in paths that don't resonably handle -EACCES, for example: writeback. The RPC layer can handle -ETIMEDOUT quite well, however - so if the handshake returns this error let's just pass it along. Fixes: 75eb6af ("SUNRPC: Add a TCP-with-TLS RPC transport class") Signed-off-by: Benjamin Coddington <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent 8f8df95 commit 7a2f6f7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

net/sunrpc/xprtsock.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2581,7 +2581,15 @@ static void xs_tls_handshake_done(void *data, int status, key_serial_t peerid)
25812581
struct sock_xprt *lower_transport =
25822582
container_of(lower_xprt, struct sock_xprt, xprt);
25832583

2584-
lower_transport->xprt_err = status ? -EACCES : 0;
2584+
switch (status) {
2585+
case 0:
2586+
case -EACCES:
2587+
case -ETIMEDOUT:
2588+
lower_transport->xprt_err = status;
2589+
break;
2590+
default:
2591+
lower_transport->xprt_err = -EACCES;
2592+
}
25852593
complete(&lower_transport->handshake_done);
25862594
xprt_put(lower_xprt);
25872595
}

0 commit comments

Comments
 (0)