diff mbox series

[30/42] lnet: socklnd: clarify error message on timeout

Message ID 1674514855-15399-31-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series lustre: sync to OpenSFS tree as of Jan 22 2023 | expand

Commit Message

James Simmons Jan. 23, 2023, 11 p.m. UTC
From: Aurelien Degremont <degremoa@amazon.com>

When the local peer times out when writing
to another peer, prints an explicit error message
rather than a generic one. This is make it clearer
for admins and easier to debug.

Add port to help determining if this is always
the same one or not.

WC-bug-id: https://jira.whamcloud.com/browse/LU-16439
Lustre-commit: 5b06ba9d46e19b9d7 ("LU-16439 socklnd: clarify error message on timeout")
Signed-off-by: Aurelien Degremont <degremoa@amazon.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49540
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Cyril Bordage <cbordage@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 net/lnet/klnds/socklnd/socklnd_cb.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/net/lnet/klnds/socklnd/socklnd_cb.c b/net/lnet/klnds/socklnd/socklnd_cb.c
index 15fba9d7f0ac..17ea0cca9255 100644
--- a/net/lnet/klnds/socklnd/socklnd_cb.c
+++ b/net/lnet/klnds/socklnd/socklnd_cb.c
@@ -533,11 +533,15 @@  ksocknal_process_transmit(struct ksock_conn *conn, struct ksock_tx *tx)
 	if (!conn->ksnc_closing) {
 		switch (rc) {
 		case -ECONNRESET:
-			LCONSOLE_WARN("Host %pISc reset our connection while we were sending data; it may have rebooted.\n",
-				      &conn->ksnc_peeraddr);
+			LCONSOLE_WARN("Host %pISc reset our connection while we were sending data; it may have rebooted: rc = %d\n",
+				      &conn->ksnc_peeraddr, rc);
+			break;
+		case -ETIMEDOUT:
+			LCONSOLE_WARN("Timeout error while writing to %pISp. Closing socket: rc = %d\n",
+				      &conn->ksnc_peeraddr, rc);
 			break;
 		default:
-			LCONSOLE_WARN("There was an unexpected network error while writing to %pISc: %d.\n",
+			LCONSOLE_WARN("There was an unexpected network error while writing to %pISc: rc = %d\n",
 				      &conn->ksnc_peeraddr, rc);
 			break;
 		}