On Wed, Nov 09, 2022 at 08:47:54AM +0100, Hannes Reinecke wrote: > 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 <Niklas.Cassel@xxxxxxx> > Cc: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx> > Cc: John Garry <john.garry@xxxxxxxxxx> > Signed-off-by: Hannes Reinecke <hare@xxxxxxx> > --- > drivers/scsi/scsi_error.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c > index be2a70c5ac6d..e9f9c8f52c59 100644 > --- a/drivers/scsi/scsi_error.c > +++ b/drivers/scsi/scsi_error.c > @@ -242,6 +242,11 @@ scsi_abort_command(struct scsi_cmnd *scmd) > return FAILED; > } > > + if (!shost->hostt->eh_abort_handler) { > + /* No abort handler, fail command directly */ > + return FAILED; > + } > + > spin_lock_irqsave(shost->host_lock, flags); > if (shost->eh_deadline != -1 && !shost->last_reset) > shost->last_reset = jiffies; > -- > 2.35.3 > Tested-by: Niklas Cassel <niklas.cassel@xxxxxxx>