From fd129d25d33dafeba4446733905b4a70013286e7 Mon Sep 17 00:00:00 2001 From: gulams <64251312+gulams@users.noreply.github.com> Date: Tue, 20 Apr 2021 00:32:02 +0530 Subject: Check ISCSI_ERR_ISCSID_NOTCONN in iscsistart login In login_session() function, we need to check for error ISCSI_ERR_ISCSID_NOTCONN also. When the login command is sent to the iscsid using iscsid_exec_req(), it will try to connect to iscsid using the function ipc_connect(). If there is an issue in iscsid or if we are not able to create the socket due to some reason, then the error ISCSI_ERR_ISCSID_NOTCONN is returned. We need to retry the login command by checking the error ISCSI_ERR_ISCSID_NOTCONN. --- usr/iscsistart.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr/iscsistart.c b/usr/iscsistart.c index 755489f..206cd4c 100644 --- a/usr/iscsistart.c +++ b/usr/iscsistart.c @@ -259,7 +259,8 @@ static int login_session(struct node_rec *rec) rc = iscsid_exec_req(&req, &rsp, 0, tmo); if (rc == 0) { return rc; - } else if (rc == ISCSI_ERR_SESSION_NOT_CONNECTED) { + } else if (rc == ISCSI_ERR_SESSION_NOT_CONNECTED || + rc == ISCSI_ERR_ISCSID_NOTCONN) { ts.tv_sec = msec / 1000; ts.tv_nsec = (msec % 1000) * 1000000L; -- cgit v1.2.1