|
@@ -425,6 +425,7 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_
|
|
unsigned long ptr;
|
|
unsigned long ptr;
|
|
struct fc_rport_priv *rdata;
|
|
struct fc_rport_priv *rdata;
|
|
spinlock_t *io_lock = NULL;
|
|
spinlock_t *io_lock = NULL;
|
|
|
|
+ int io_lock_acquired = 0;
|
|
|
|
|
|
if (unlikely(fnic_chk_state_flags_locked(fnic, FNIC_FLAGS_IO_BLOCKED)))
|
|
if (unlikely(fnic_chk_state_flags_locked(fnic, FNIC_FLAGS_IO_BLOCKED)))
|
|
return SCSI_MLQUEUE_HOST_BUSY;
|
|
return SCSI_MLQUEUE_HOST_BUSY;
|
|
@@ -518,6 +519,7 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_
|
|
spin_lock_irqsave(io_lock, flags);
|
|
spin_lock_irqsave(io_lock, flags);
|
|
|
|
|
|
/* initialize rest of io_req */
|
|
/* initialize rest of io_req */
|
|
|
|
+ io_lock_acquired = 1;
|
|
io_req->port_id = rport->port_id;
|
|
io_req->port_id = rport->port_id;
|
|
io_req->start_time = jiffies;
|
|
io_req->start_time = jiffies;
|
|
CMD_STATE(sc) = FNIC_IOREQ_CMD_PENDING;
|
|
CMD_STATE(sc) = FNIC_IOREQ_CMD_PENDING;
|
|
@@ -571,7 +573,7 @@ out:
|
|
(((u64)CMD_FLAGS(sc) >> 32) | CMD_STATE(sc)));
|
|
(((u64)CMD_FLAGS(sc) >> 32) | CMD_STATE(sc)));
|
|
|
|
|
|
/* if only we issued IO, will we have the io lock */
|
|
/* if only we issued IO, will we have the io lock */
|
|
- if (CMD_FLAGS(sc) & FNIC_IO_INITIALIZED)
|
|
|
|
|
|
+ if (io_lock_acquired)
|
|
spin_unlock_irqrestore(io_lock, flags);
|
|
spin_unlock_irqrestore(io_lock, flags);
|
|
|
|
|
|
atomic_dec(&fnic->in_flight);
|
|
atomic_dec(&fnic->in_flight);
|