Re: [External] : [PATCH] scsi_error: do not queue pointless abort workqueue functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/11/2022 07:47, 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.

Do we ever use shost->tmf_work_q in this case? Doesn't seem much point in allocating it, apart from keeping the code simpler


Cc: Niklas Cassel <Niklas.Cassel@xxxxxxx>
Cc: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx>
Cc: John Garry <john.garry@xxxxxxxxxx>

That's someone else :)

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) {

nit: no need for {}, but maybe better put comment above the check if removing it. However maybe it's also a bit obvious comment.

+		/* 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;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux