aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libiscsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/libiscsi.c')
-rw-r--r--drivers/scsi/libiscsi.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index b7a2b9ad3a97..441e351b4456 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -1079,17 +1079,19 @@ int iscsi_eh_host_reset(struct scsi_cmnd *sc)
1079 struct iscsi_session *session = iscsi_hostdata(host->hostdata); 1079 struct iscsi_session *session = iscsi_hostdata(host->hostdata);
1080 struct iscsi_conn *conn = session->leadconn; 1080 struct iscsi_conn *conn = session->leadconn;
1081 1081
1082 mutex_lock(&session->eh_mutex);
1082 spin_lock_bh(&session->lock); 1083 spin_lock_bh(&session->lock);
1083 if (session->state == ISCSI_STATE_TERMINATE) { 1084 if (session->state == ISCSI_STATE_TERMINATE) {
1084failed: 1085failed:
1085 debug_scsi("failing host reset: session terminated " 1086 debug_scsi("failing host reset: session terminated "
1086 "[CID %d age %d]\n", conn->id, session->age); 1087 "[CID %d age %d]\n", conn->id, session->age);
1087 spin_unlock_bh(&session->lock); 1088 spin_unlock_bh(&session->lock);
1089 mutex_unlock(&session->eh_mutex);
1088 return FAILED; 1090 return FAILED;
1089 } 1091 }
1090 1092
1091 spin_unlock_bh(&session->lock); 1093 spin_unlock_bh(&session->lock);
1092 1094 mutex_unlock(&session->eh_mutex);
1093 /* 1095 /*
1094 * we drop the lock here but the leadconn cannot be destoyed while 1096 * we drop the lock here but the leadconn cannot be destoyed while
1095 * we are in the scsi eh 1097 * we are in the scsi eh
@@ -1104,13 +1106,14 @@ failed:
1104 if (signal_pending(current)) 1106 if (signal_pending(current))
1105 flush_signals(current); 1107 flush_signals(current);
1106 1108
1109 mutex_lock(&session->eh_mutex);
1107 spin_lock_bh(&session->lock); 1110 spin_lock_bh(&session->lock);
1108 if (session->state == ISCSI_STATE_LOGGED_IN) 1111 if (session->state == ISCSI_STATE_LOGGED_IN)
1109 printk(KERN_INFO "iscsi: host reset succeeded\n"); 1112 printk(KERN_INFO "iscsi: host reset succeeded\n");
1110 else 1113 else
1111 goto failed; 1114 goto failed;
1112 spin_unlock_bh(&session->lock); 1115 spin_unlock_bh(&session->lock);
1113 1116 mutex_unlock(&session->eh_mutex);
1114 return SUCCESS; 1117 return SUCCESS;
1115} 1118}
1116EXPORT_SYMBOL_GPL(iscsi_eh_host_reset); 1119EXPORT_SYMBOL_GPL(iscsi_eh_host_reset);