Commit 7a2f6f76 authored by Benjamin Coddington's avatar Benjamin Coddington Committed by Anna Schumaker
Browse files

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: 75eb6af7 ("SUNRPC: Add a TCP-with-TLS RPC transport class")
Signed-off-by: default avatarBenjamin Coddington <bcodding@redhat.com>
Signed-off-by: default avatarAnna Schumaker <anna.schumaker@oracle.com>
parent 8f8df955
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -2581,7 +2581,15 @@ static void xs_tls_handshake_done(void *data, int status, key_serial_t peerid)
	struct sock_xprt *lower_transport =
				container_of(lower_xprt, struct sock_xprt, xprt);

	lower_transport->xprt_err = status ? -EACCES : 0;
	switch (status) {
	case 0:
	case -EACCES:
	case -ETIMEDOUT:
		lower_transport->xprt_err = status;
		break;
	default:
		lower_transport->xprt_err = -EACCES;
	}
	complete(&lower_transport->handshake_done);
	xprt_put(lower_xprt);
}