public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix SCSI async abort handling when eh_deadline is active
@ 2021-10-25 14:39 Ewan D. Milne
  2021-10-25 14:39 ` [PATCH 1/2] scsi: core: avoid leaving shost->last_reset with stale value if EH does not run Ewan D. Milne
  2021-10-25 14:39 ` [PATCH 2/2] scsi: core: simplify control flow in scmd_eh_abort_handler Ewan D. Milne
  0 siblings, 2 replies; 7+ messages in thread
From: Ewan D. Milne @ 2021-10-25 14:39 UTC (permalink / raw)
  To: linux-scsi

There is a code path in the SCSI async abort handling that can cause error
handling of subsequent scsi_cmnds to proceed immediately to host reset with no
other attempt at recovery.

This can be seen by the following:

    modprobe scsi_debug every_nth=10 opts=4
    echo 7 > /sys/module/scsi_mod/parameters/scsi_logging_level
    echo 10 > /sys/devices/pseudo_0/adapter0/host8/scsi_host/host<N>/eh_deadline

and performing I/O to the scsi_debug device, the host will get reset immediately
when prior aborts succeeded, because ->last_reset does not get invalidated.

The patch series contains a fix, followed by a simplification
of the control flow to remove duplicate code.  Only the first patch
is Cc: stable as the second part doesn't qualify.  Yes, I know the
first patch is >100 lines, I couldn't make it smaller unfortunately.

Signed-off-by: Ewan D. Milne <emilne@redhat.com>

Ewan D. Milne (2):
  scsi: core: avoid leaving shost->last_reset with stale value if EH
    does not run
  scsi: core: simplify control flow in scmd_eh_abort_handler

 drivers/scsi/hosts.c      |  1 +
 drivers/scsi/scsi_error.c | 92 ++++++++++++++++++++++++++++++-----------------
 drivers/scsi/scsi_lib.c   |  1 +
 include/scsi/scsi_cmnd.h  |  2 +-
 include/scsi/scsi_host.h  |  1 +
 5 files changed, 63 insertions(+), 34 deletions(-)

-- 
2.1.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-10-28 20:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-25 14:39 [PATCH 0/2] Fix SCSI async abort handling when eh_deadline is active Ewan D. Milne
2021-10-25 14:39 ` [PATCH 1/2] scsi: core: avoid leaving shost->last_reset with stale value if EH does not run Ewan D. Milne
2021-10-28  3:29   ` Martin K. Petersen
2021-10-28 20:44     ` Ewan D. Milne
2021-10-25 14:39 ` [PATCH 2/2] scsi: core: simplify control flow in scmd_eh_abort_handler Ewan D. Milne
2021-10-28  3:31   ` Martin K. Petersen
2021-10-28 20:45     ` Ewan D. Milne

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox