Mike Christie wrote:
> So just wait a sec for the patch. I need to retest for regressions. I 
> should have it out today and pushed in fedora this evening.
> 

Here is the patch I am thinking about. It works here.

I want to take some time to make sure it is ok, so instead of today, I 
am going to push it in a new open-iscsi.org fix release and updated 
fedora rpm this weekend.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~----------~----~----~----~------~----~------~--~---

diff --git a/usr/initiator.c b/usr/initiator.c
index 10cf050..3247b33 100644
--- a/usr/initiator.c
+++ b/usr/initiator.c
@@ -153,7 +153,8 @@ __login_response_status(iscsi_conn_t *conn,
        case LOGIN_REDIRECTION_FAILED:
                return CONN_LOGIN_RETRY;
        default:
-               log_error("conn %d giving up on login attempts", conn->id);
+               log_error("Login error (Login status %d) on conn %d", conn->id,
+                         login_status);
                break;
        }
 
@@ -217,8 +218,7 @@ __check_iscsi_status_class(iscsi_session_t *session, int 
cid,
                        return CONN_LOGIN_FAILED;
                default:
                        log_error("conn %d login rejected: initiator "
-                              "error (%02x/%02x), non-retryable, "
-                              "giving up", conn->id, status_class,
+                              "error (%02x/%02x)", conn->id, status_class,
                               status_detail);
                        return CONN_LOGIN_FAILED;
                }
@@ -827,7 +827,8 @@ static void iscsi_login_eh(struct iscsi_conn *conn, struct 
queue_task *qtask,
                                  "R_STAGE_NO_CHANGE");
                        /* timeout during initial connect.
                         * clean connection. write ipc rsp or retry */
-                       if (!iscsi_retry_initial_login(conn))
+                       if (err == MGMT_IPC_ERR_FATAL_LOGIN_FAILURE ||
+                           !iscsi_retry_initial_login(conn))
                                session_conn_shutdown(conn, qtask, err);
                        else {
                                session->reopen_cnt++;
@@ -842,7 +843,8 @@ static void iscsi_login_eh(struct iscsi_conn *conn, struct 
queue_task *qtask,
                                  "R_STAGE_SESSION_REDIRECT");
                        /* timeout during initial redirect connect
                         * clean connection. write ipc rsp or retry */
-                       if (!iscsi_retry_initial_login(conn))
+                       if (err == MGMT_IPC_ERR_FATAL_LOGIN_FAILURE ||
+                           !iscsi_retry_initial_login(conn))
                                session_conn_shutdown(conn, qtask, err);
                        else
                                session_conn_reopen(conn, qtask, 0);
@@ -874,7 +876,8 @@ static void iscsi_login_eh(struct iscsi_conn *conn, struct 
queue_task *qtask,
                         * initial redirected connect. Clean connection
                         * and write rsp or retry.
                         */
-                       if (!iscsi_retry_initial_login(conn))
+                       if (err == MGMT_IPC_ERR_FATAL_LOGIN_FAILURE ||
+                           !iscsi_retry_initial_login(conn))
                                session_conn_shutdown(conn, qtask, err);
                        else
                                session_conn_reopen(conn, qtask,
@@ -1666,10 +1669,9 @@ retry:
        iscsi_login_eh(conn, c->qtask, MGMT_IPC_ERR_LOGIN_FAILURE);
        return;
 failed:
-       /* force faulure */
-       session->r_stage = R_STAGE_NO_CHANGE;
+       /* force failure if initial login */
        session->reopen_cnt = session->nrec.session.initial_login_retry_max;
-       iscsi_login_eh(conn, c->qtask, MGMT_IPC_ERR_LOGIN_FAILURE);
+       iscsi_login_eh(conn, c->qtask, MGMT_IPC_ERR_FATAL_LOGIN_FAILURE);
        return;
 }
 
diff --git a/usr/mgmt_ipc.h b/usr/mgmt_ipc.h
index e2eaae2..e2037cf 100644
--- a/usr/mgmt_ipc.h
+++ b/usr/mgmt_ipc.h
@@ -46,6 +46,7 @@ typedef enum mgmt_ipc_err {
        MGMT_IPC_ERR_INVALID_REQ        = 16,
        MGMT_IPC_ERR_ISNS_UNAVAILABLE   = 17,
        MGMT_IPC_ERR_ISCSID_COMM_ERR    = 18,
+       MGMT_IPC_ERR_FATAL_LOGIN_FAILURE = 19,
 } mgmt_ipc_err_e;
 
 typedef enum iscsiadm_cmd {
diff --git a/usr/util.c b/usr/util.c
index f3b9afd..a370a6b 100644
--- a/usr/util.c
+++ b/usr/util.c
@@ -330,6 +330,7 @@ void iscsid_handle_error(mgmt_ipc_err_e err)
                /* 16 */ "Unknown request",
                /* 17 */ "encountered iSNS failure",
                /* 18 */ "could not communicate to iscsid",
+               /* 19 */ "encountered non-retryable iSCSI login failure",
        };
        log_error("initiator reported error (%d - %s)", err, err_msgs[err]);
 }

Reply via email to