aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/libiscsi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 4461317e617f..b0bc8c3b0ecb 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -1010,8 +1010,9 @@ int iscsi_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
1010 sc->SCp.ptr = NULL; 1010 sc->SCp.ptr = NULL;
1011 1011
1012 host = sc->device->host; 1012 host = sc->device->host;
1013 session = iscsi_hostdata(host->hostdata); 1013 spin_unlock(host->host_lock);
1014 1014
1015 session = iscsi_hostdata(host->hostdata);
1015 spin_lock(&session->lock); 1016 spin_lock(&session->lock);
1016 1017
1017 /* 1018 /*
@@ -1077,11 +1078,13 @@ int iscsi_queuecommand(struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *))
1077 spin_unlock(&session->lock); 1078 spin_unlock(&session->lock);
1078 1079
1079 scsi_queue_work(host, &conn->xmitwork); 1080 scsi_queue_work(host, &conn->xmitwork);
1081 spin_lock(host->host_lock);
1080 return 0; 1082 return 0;
1081 1083
1082reject: 1084reject:
1083 spin_unlock(&session->lock); 1085 spin_unlock(&session->lock);
1084 debug_scsi("cmd 0x%x rejected (%d)\n", sc->cmnd[0], reason); 1086 debug_scsi("cmd 0x%x rejected (%d)\n", sc->cmnd[0], reason);
1087 spin_lock(host->host_lock);
1085 return SCSI_MLQUEUE_HOST_BUSY; 1088 return SCSI_MLQUEUE_HOST_BUSY;
1086 1089
1087fault: 1090fault:
@@ -1091,6 +1094,7 @@ fault:
1091 sc->result = (DID_NO_CONNECT << 16); 1094 sc->result = (DID_NO_CONNECT << 16);
1092 scsi_set_resid(sc, scsi_bufflen(sc)); 1095 scsi_set_resid(sc, scsi_bufflen(sc));
1093 sc->scsi_done(sc); 1096 sc->scsi_done(sc);
1097 spin_lock(host->host_lock);
1094 return 0; 1098 return 0;
1095} 1099}
1096EXPORT_SYMBOL_GPL(iscsi_queuecommand); 1100EXPORT_SYMBOL_GPL(iscsi_queuecommand);