From 6ff0c0cfb440db8a5c0b789e4e605bf679994a52 Mon Sep 17 00:00:00 2001 From: Ziye Yang Date: Mon, 28 May 2018 10:46:23 +0800 Subject: [PATCH] iscsi: Do not output error for connect reset issue The initiator may close the connection unexpectly due to many differnent reasons, which should not print error log of our SPDK iSCSI target. Change-Id: I652be75c0762547f27212503e5b52bfc898ecc8f Signed-off-by: Ziye Yang Reviewed-on: https://review.gerrithub.io/412593 Tested-by: SPDK Automated Test System Reviewed-by: Changpeng Liu Reviewed-by: Shuhei Matsumoto Reviewed-by: Ben Walker --- lib/iscsi/conn.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/iscsi/conn.c b/lib/iscsi/conn.c index 09a51a49a..d387bcde3 100644 --- a/lib/iscsi/conn.c +++ b/lib/iscsi/conn.c @@ -737,8 +737,14 @@ spdk_iscsi_conn_read_data(struct spdk_iscsi_conn *conn, int bytes, if (errno == EAGAIN || errno == EWOULDBLOCK) { return 0; } else { - SPDK_ERRLOG("spdk_sock_recv() failed, errno %d: %s\n", - errno, spdk_strerror(errno)); + /* For connect reset issue, do not output error log */ + if (errno == ECONNRESET) { + SPDK_DEBUGLOG(SPDK_LOG_ISCSI, "spdk_sock_recv() failed, errno %d: %s\n", + errno, spdk_strerror(errno)); + } else { + SPDK_ERRLOG("spdk_sock_recv() failed, errno %d: %s\n", + errno, spdk_strerror(errno)); + } } return SPDK_ISCSI_CONNECTION_FATAL; }