Skip to content

Commit d0b9025

Browse files
hreineckemartinkpetersen
authored andcommitted
scsi: core: scsi_error: Do not queue pointless abort workqueue functions
If a host template doesn't implement the .eh_abort_handler() there is no point in queueing the abort workqueue function; all it does is invoking SCSI EH anyway. So return 'FAILED' from scsi_abort_command() if the .eh_abort_handler() is not implemented and save us from having to wait for the abort workqueue function to complete. Cc: Niklas Cassel <[email protected]> Cc: Damien Le Moal <[email protected]> Cc: John Garry <[email protected]> Signed-off-by: Hannes Reinecke <[email protected]> [niklas: moved the check to the top of scsi_abort_command()] Signed-off-by: Niklas Cassel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 67ff3d0 commit d0b9025

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/scsi/scsi_error.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,11 @@ scsi_abort_command(struct scsi_cmnd *scmd)
231231
struct Scsi_Host *shost = sdev->host;
232232
unsigned long flags;
233233

234+
if (!shost->hostt->eh_abort_handler) {
235+
/* No abort handler, fail command directly */
236+
return FAILED;
237+
}
238+
234239
if (scmd->eh_eflags & SCSI_EH_ABORT_SCHEDULED) {
235240
/*
236241
* Retry after abort failed, escalate to next level.

0 commit comments

Comments
 (0)