Commit 7b594131 authored by Mike Christie's avatar Mike Christie Committed by James Bottomley

[SCSI] qla2xxx: return SCSI_MLQUEUE_TARGET_BUSY when driver has detected rport error or race

If the fcport is not online then we do not want to block IO to all ports on
the host. We just want to stop IO on port not online, so we should be using
the SCSI_MLQUEUE_TARGET_BUSY return value.

For the case where we race with the rport memset initialization
we do not want the queuecommand to be called again so we can just use
SCSI_MLQUEUE_TARGET_BUSY for this.
Signed-off-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Acked-by: default avatarAndrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent c5e98e91
...@@ -394,10 +394,8 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) ...@@ -394,10 +394,8 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
} }
/* Close window on fcport/rport state-transitioning. */ /* Close window on fcport/rport state-transitioning. */
if (fcport->drport) { if (fcport->drport)
cmd->result = DID_IMM_RETRY << 16; goto qc_target_busy;
goto qc_fail_command;
}
if (atomic_read(&fcport->state) != FCS_ONLINE) { if (atomic_read(&fcport->state) != FCS_ONLINE) {
if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD || if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
...@@ -405,7 +403,7 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) ...@@ -405,7 +403,7 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
cmd->result = DID_NO_CONNECT << 16; cmd->result = DID_NO_CONNECT << 16;
goto qc_fail_command; goto qc_fail_command;
} }
goto qc_host_busy; goto qc_target_busy;
} }
spin_unlock_irq(ha->host->host_lock); spin_unlock_irq(ha->host->host_lock);
...@@ -428,10 +426,11 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) ...@@ -428,10 +426,11 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
qc_host_busy_lock: qc_host_busy_lock:
spin_lock_irq(ha->host->host_lock); spin_lock_irq(ha->host->host_lock);
qc_host_busy:
return SCSI_MLQUEUE_HOST_BUSY; return SCSI_MLQUEUE_HOST_BUSY;
qc_target_busy:
return SCSI_MLQUEUE_TARGET_BUSY;
qc_fail_command: qc_fail_command:
done(cmd); done(cmd);
...@@ -461,10 +460,8 @@ qla24xx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) ...@@ -461,10 +460,8 @@ qla24xx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
} }
/* Close window on fcport/rport state-transitioning. */ /* Close window on fcport/rport state-transitioning. */
if (fcport->drport) { if (fcport->drport)
cmd->result = DID_IMM_RETRY << 16; goto qc24_target_busy;
goto qc24_fail_command;
}
if (atomic_read(&fcport->state) != FCS_ONLINE) { if (atomic_read(&fcport->state) != FCS_ONLINE) {
if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD || if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
...@@ -472,7 +469,7 @@ qla24xx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) ...@@ -472,7 +469,7 @@ qla24xx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
cmd->result = DID_NO_CONNECT << 16; cmd->result = DID_NO_CONNECT << 16;
goto qc24_fail_command; goto qc24_fail_command;
} }
goto qc24_host_busy; goto qc24_target_busy;
} }
spin_unlock_irq(ha->host->host_lock); spin_unlock_irq(ha->host->host_lock);
...@@ -495,10 +492,11 @@ qla24xx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) ...@@ -495,10 +492,11 @@ qla24xx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
qc24_host_busy_lock: qc24_host_busy_lock:
spin_lock_irq(ha->host->host_lock); spin_lock_irq(ha->host->host_lock);
qc24_host_busy:
return SCSI_MLQUEUE_HOST_BUSY; return SCSI_MLQUEUE_HOST_BUSY;
qc24_target_busy:
return SCSI_MLQUEUE_TARGET_BUSY;
qc24_fail_command: qc24_fail_command:
done(cmd); done(cmd);
......
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