Skip to content

Commit 2a0c984

Browse files
bcodding-rhmehmetb0
authored andcommitted
tls: Fix tls_sw_sendmsg error handling
BugLink: https://bugs.launchpad.net/bugs/2106770 [ Upstream commit b341ca51d2679829d26a3f6a4aa9aee9abd94f92 ] We've noticed that NFS can hang when using RPC over TLS on an unstable connection, and investigation shows that the RPC layer is stuck in a tight loop attempting to transmit, but forever getting -EBADMSG back from the underlying network. The loop begins when tcp_sendmsg_locked() returns -EPIPE to tls_tx_records(), but that error is converted to -EBADMSG when calling the socket's error reporting handler. Instead of converting errors from tcp_sendmsg_locked(), let's pass them along in this path. The RPC layer handles -EPIPE by reconnecting the transport, which prevents the endless attempts to transmit on a broken connection. Signed-off-by: Benjamin Coddington <[email protected]> Fixes: a42055e ("net/tls: Add support for async encryption of records for performance") Link: https://patch.msgid.link/9594185559881679d81f071b181a10eb07cd079f.1736004079.git.bcodding@redhat.com Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Manuel Diewald <[email protected]> Signed-off-by: Mehmet Basaran <[email protected]>
1 parent 6b822d1 commit 2a0c984

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/tls/tls_sw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ int tls_tx_records(struct sock *sk, int flags)
458458

459459
tx_err:
460460
if (rc < 0 && rc != -EAGAIN)
461-
tls_err_abort(sk, -EBADMSG);
461+
tls_err_abort(sk, rc);
462462

463463
return rc;
464464
}

0 commit comments

Comments
 (0)