Move retries check to scsi_queue_insert. Signed-off-by: Mike Anderson <andmike@xxxxxxxxxxxxxxxxxx> Acked-by: Mike Christie <michaelc@xxxxxxxxxxx> --- drivers/scsi/scsi_error.c | 8 ++------ drivers/scsi/scsi_lib.c | 7 +++++++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index d8000ef..55bf0e5 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -1320,8 +1320,6 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd) case DID_SOFT_ERROR: goto maybe_retry; case DID_IMM_RETRY: - return NEEDS_RETRY; - case DID_REQUEUE: return ADD_TO_MLQUEUE; case DID_TRANSPORT_DISRUPTED: @@ -1429,8 +1427,7 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd) * the request was not marked fast fail. Note that above, * even if the request is marked fast fail, we still requeue * for queue congestion conditions (QUEUE_FULL or BUSY) */ - if ((++scmd->retries) <= scmd->allowed - && !scsi_noretry_cmd(scmd)) { + if (!blk_noretry_request(scmd->request)) { return NEEDS_RETRY; } else { /* @@ -1555,8 +1552,7 @@ void scsi_eh_flush_done_q(struct list_head *done_q) list_for_each_entry_safe(scmd, next, done_q, eh_entry) { list_del_init(&scmd->eh_entry); if (scsi_device_online(scmd->device) && - !scsi_noretry_cmd(scmd) && - (++scmd->retries <= scmd->allowed)) { + !blk_noretry_request(scmd->request)) { SCSI_LOG_ERROR_RECOVERY(3, printk("%s: flush" " retry cmd: %p\n", current->comm, diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 83a8aae..557e511 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -153,6 +153,13 @@ int scsi_queue_insert(struct scsi_cmnd *cmd, int reason) case SCSI_MLQUEUE_TARGET_BUSY: starget->target_blocked = starget->max_target_blocked; break; + case SCSI_MLQUEUE_EH_RETRY: + if (++cmd->retries > cmd->allowed) { + set_driver_byte(cmd, DRIVER_TIMEOUT); + scsi_finish_command(cmd); + return 0; + } + break; } /* -- 1.5.5.1 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html