summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgulams <64251312+gulams@users.noreply.github.com>2021-04-20 00:32:02 +0530
committerGitHub <noreply@github.com>2021-04-20 00:32:02 +0530
commitfd129d25d33dafeba4446733905b4a70013286e7 (patch)
treeb1585b42f606ebaf89609fb366d534189f97761b
parent2418580cddc8ec851c5fb75a91b605e12fec5aea (diff)
downloadopen-iscsi-fd129d25d33dafeba4446733905b4a70013286e7.tar.gz
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.
-rw-r--r--usr/iscsistart.c3
1 files changed, 2 insertions, 1 deletions
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;