Commit df4da5cd authored by Mike Christie's avatar Mike Christie Committed by James Bottomley

[SCSI] libiscsi: add more informative failure message during iscsi scsi eh

This adds a more informative error code and message
for the iscsi scsi eh session drop paths. This allows
you to distinguish if the session was dropped due to
a connection failure vs the iscsi layer dropping
the session due to scsi eh failure processing.
Signed-off-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 5c100075
...@@ -1796,9 +1796,9 @@ static int iscsi_exec_task_mgmt_fn(struct iscsi_conn *conn, ...@@ -1796,9 +1796,9 @@ static int iscsi_exec_task_mgmt_fn(struct iscsi_conn *conn,
NULL, 0); NULL, 0);
if (!task) { if (!task) {
spin_unlock_bh(&session->lock); spin_unlock_bh(&session->lock);
iscsi_conn_printk(KERN_ERR, conn, "Could not send TMF.\n");
iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED); iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
spin_lock_bh(&session->lock); spin_lock_bh(&session->lock);
ISCSI_DBG_EH(session, "tmf exec failure\n");
return -EPERM; return -EPERM;
} }
conn->tmfcmd_pdus_cnt++; conn->tmfcmd_pdus_cnt++;
...@@ -2203,7 +2203,7 @@ int iscsi_eh_abort(struct scsi_cmnd *sc) ...@@ -2203,7 +2203,7 @@ int iscsi_eh_abort(struct scsi_cmnd *sc)
goto success_unlocked; goto success_unlocked;
case TMF_TIMEDOUT: case TMF_TIMEDOUT:
spin_unlock_bh(&session->lock); spin_unlock_bh(&session->lock);
iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED); iscsi_conn_failure(conn, ISCSI_ERR_SCSI_EH_SESSION_RST);
goto failed_unlocked; goto failed_unlocked;
case TMF_NOT_FOUND: case TMF_NOT_FOUND:
if (!sc->SCp.ptr) { if (!sc->SCp.ptr) {
...@@ -2290,7 +2290,7 @@ int iscsi_eh_device_reset(struct scsi_cmnd *sc) ...@@ -2290,7 +2290,7 @@ int iscsi_eh_device_reset(struct scsi_cmnd *sc)
break; break;
case TMF_TIMEDOUT: case TMF_TIMEDOUT:
spin_unlock_bh(&session->lock); spin_unlock_bh(&session->lock);
iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED); iscsi_conn_failure(conn, ISCSI_ERR_SCSI_EH_SESSION_RST);
goto done; goto done;
default: default:
conn->tmf_state = TMF_INITIAL; conn->tmf_state = TMF_INITIAL;
...@@ -2371,7 +2371,7 @@ int iscsi_eh_session_reset(struct scsi_cmnd *sc) ...@@ -2371,7 +2371,7 @@ int iscsi_eh_session_reset(struct scsi_cmnd *sc)
* we drop the lock here but the leadconn cannot be destoyed while * we drop the lock here but the leadconn cannot be destoyed while
* we are in the scsi eh * we are in the scsi eh
*/ */
iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED); iscsi_conn_failure(conn, ISCSI_ERR_SCSI_EH_SESSION_RST);
ISCSI_DBG_EH(session, "wait for relogin\n"); ISCSI_DBG_EH(session, "wait for relogin\n");
wait_event_interruptible(conn->ehwait, wait_event_interruptible(conn->ehwait,
...@@ -2453,7 +2453,7 @@ int iscsi_eh_target_reset(struct scsi_cmnd *sc) ...@@ -2453,7 +2453,7 @@ int iscsi_eh_target_reset(struct scsi_cmnd *sc)
break; break;
case TMF_TIMEDOUT: case TMF_TIMEDOUT:
spin_unlock_bh(&session->lock); spin_unlock_bh(&session->lock);
iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED); iscsi_conn_failure(conn, ISCSI_ERR_SCSI_EH_SESSION_RST);
goto done; goto done;
default: default:
conn->tmf_state = TMF_INITIAL; conn->tmf_state = TMF_INITIAL;
......
...@@ -263,6 +263,7 @@ enum iscsi_err { ...@@ -263,6 +263,7 @@ enum iscsi_err {
ISCSI_ERR_INVALID_HOST = ISCSI_ERR_BASE + 18, ISCSI_ERR_INVALID_HOST = ISCSI_ERR_BASE + 18,
ISCSI_ERR_XMIT_FAILED = ISCSI_ERR_BASE + 19, ISCSI_ERR_XMIT_FAILED = ISCSI_ERR_BASE + 19,
ISCSI_ERR_TCP_CONN_CLOSE = ISCSI_ERR_BASE + 20, ISCSI_ERR_TCP_CONN_CLOSE = ISCSI_ERR_BASE + 20,
ISCSI_ERR_SCSI_EH_SESSION_RST = ISCSI_ERR_BASE + 21,
}; };
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment