aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libiscsi.c
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2010-12-31 03:22:18 -0500
committerJames Bottomley <James.Bottomley@suse.de>2010-12-31 10:51:54 -0500
commitdf4da5cdfca05b37b366b9c69925b68586969c1c (patch)
treefd5b1c7a6de1c32092e5f4635462ffbe71c029f5 /drivers/scsi/libiscsi.c
parent5c10007560589a2335a77cbc92347b1474518296 (diff)
[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: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/libiscsi.c')
-rw-r--r--drivers/scsi/libiscsi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 7551abe40900..3eddab0774e4 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -1796,9 +1796,9 @@ static int iscsi_exec_task_mgmt_fn(struct iscsi_conn *conn,
1796 NULL, 0); 1796 NULL, 0);
1797 if (!task) { 1797 if (!task) {
1798 spin_unlock_bh(&session->lock); 1798 spin_unlock_bh(&session->lock);
1799 iscsi_conn_printk(KERN_ERR, conn, "Could not send TMF.\n");
1799 iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED); 1800 iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
1800 spin_lock_bh(&session->lock); 1801 spin_lock_bh(&session->lock);
1801 ISCSI_DBG_EH(session, "tmf exec failure\n");
1802 return -EPERM; 1802 return -EPERM;
1803 } 1803 }
1804 conn->tmfcmd_pdus_cnt++; 1804 conn->tmfcmd_pdus_cnt++;
@@ -2203,7 +2203,7 @@ int iscsi_eh_abort(struct scsi_cmnd *sc)
2203 goto success_unlocked; 2203 goto success_unlocked;
2204 case TMF_TIMEDOUT: 2204 case TMF_TIMEDOUT:
2205 spin_unlock_bh(&session->lock); 2205 spin_unlock_bh(&session->lock);
2206 iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED); 2206 iscsi_conn_failure(conn, ISCSI_ERR_SCSI_EH_SESSION_RST);
2207 goto failed_unlocked; 2207 goto failed_unlocked;
2208 case TMF_NOT_FOUND: 2208 case TMF_NOT_FOUND:
2209 if (!sc->SCp.ptr) { 2209 if (!sc->SCp.ptr) {
@@ -2290,7 +2290,7 @@ int iscsi_eh_device_reset(struct scsi_cmnd *sc)
2290 break; 2290 break;
2291 case TMF_TIMEDOUT: 2291 case TMF_TIMEDOUT:
2292 spin_unlock_bh(&session->lock); 2292 spin_unlock_bh(&session->lock);
2293 iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED); 2293 iscsi_conn_failure(conn, ISCSI_ERR_SCSI_EH_SESSION_RST);
2294 goto done; 2294 goto done;
2295 default: 2295 default:
2296 conn->tmf_state = TMF_INITIAL; 2296 conn->tmf_state = TMF_INITIAL;
@@ -2371,7 +2371,7 @@ failed:
2371 * we drop the lock here but the leadconn cannot be destoyed while 2371 * we drop the lock here but the leadconn cannot be destoyed while
2372 * we are in the scsi eh 2372 * we are in the scsi eh
2373 */ 2373 */
2374 iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED); 2374 iscsi_conn_failure(conn, ISCSI_ERR_SCSI_EH_SESSION_RST);
2375 2375
2376 ISCSI_DBG_EH(session, "wait for relogin\n"); 2376 ISCSI_DBG_EH(session, "wait for relogin\n");
2377 wait_event_interruptible(conn->ehwait, 2377 wait_event_interruptible(conn->ehwait,
@@ -2453,7 +2453,7 @@ int iscsi_eh_target_reset(struct scsi_cmnd *sc)
2453 break; 2453 break;
2454 case TMF_TIMEDOUT: 2454 case TMF_TIMEDOUT:
2455 spin_unlock_bh(&session->lock); 2455 spin_unlock_bh(&session->lock);
2456 iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED); 2456 iscsi_conn_failure(conn, ISCSI_ERR_SCSI_EH_SESSION_RST);
2457 goto done; 2457 goto done;
2458 default: 2458 default:
2459 conn->tmf_state = TMF_INITIAL; 2459 conn->tmf_state = TMF_INITIAL;