diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index f11f51e2465f5dea81fef1810d7368e11ff005cb..6389024869f527c56f051b0a5afac91909a87559 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -2074,6 +2074,8 @@ static void scsi_restart_operations(struct Scsi_Host *shost) spin_unlock_irqrestore(shost->host_lock, flags); } +int scsi_cancel_eh_reset; + /** * scsi_eh_ready_devs - check device ready state and recover if not. * @shost: host to be recovered. @@ -2084,13 +2086,18 @@ void scsi_eh_ready_devs(struct Scsi_Host *shost, struct list_head *work_q, struct list_head *done_q) { - if (!scsi_eh_stu(shost, work_q, done_q)) + if (!scsi_eh_stu(shost, work_q, done_q)) { + if (scsi_cancel_eh_reset) { + scsi_eh_offline_sdevs(work_q, done_q); + return; + } if (!scsi_eh_bus_device_reset(shost, work_q, done_q)) if (!scsi_eh_target_reset(shost, work_q, done_q)) if (!scsi_eh_bus_reset(shost, work_q, done_q)) if (!scsi_eh_host_reset(shost, work_q, done_q)) scsi_eh_offline_sdevs(work_q, done_q); + } } EXPORT_SYMBOL_GPL(scsi_eh_ready_devs); diff --git a/drivers/scsi/scsi_sysctl.c b/drivers/scsi/scsi_sysctl.c index 7259704a7f524ac49c60a63a72fc1db4a9a7903d..c888cf8e65b1b23e5ff6df8527d6daa870e844e0 100644 --- a/drivers/scsi/scsi_sysctl.c +++ b/drivers/scsi/scsi_sysctl.c @@ -8,16 +8,26 @@ #include #include +#include + #include "scsi_logging.h" #include "scsi_priv.h" - static struct ctl_table scsi_table[] = { { .procname = "logging_level", .data = &scsi_logging_level, .maxlen = sizeof(scsi_logging_level), .mode = 0644, .proc_handler = proc_dointvec }, + + { .procname = "scsi_cancel_eh_reset", + .data = &scsi_cancel_eh_reset, + .maxlen = sizeof(scsi_cancel_eh_reset), + .mode = 0644, + .proc_handler = proc_dointvec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 = SYSCTL_ONE, + }, { } }; diff --git a/include/scsi/scsi_eh.h b/include/scsi/scsi_eh.h index 6bd5ed695a5e8c3aed3869dad7c712bdd3234079..7662805c9a30eec63060b389106df189e795671a 100644 --- a/include/scsi/scsi_eh.h +++ b/include/scsi/scsi_eh.h @@ -51,5 +51,6 @@ extern void scsi_eh_prep_cmnd(struct scsi_cmnd *scmd, extern void scsi_eh_restore_cmnd(struct scsi_cmnd* scmd, struct scsi_eh_save *ses); +extern int scsi_cancel_eh_reset; #endif /* _SCSI_SCSI_EH_H */