Re: [PATCH 06/10] scsi_error: iterate over list of failed commands in scsi_eh_bus_reset()

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

 



On Mon, Oct 23, 2023 at 11:28:33AM +0200, Hannes Reinecke wrote:
> Iterating over all possible bus number in scsi_eh_bus_reset() is
> inefficient as not all busses may be affected during SCSI EH.
> So rewrite the loop in scsi_eh_bus_reset() to match the loop
> in scsi_eh_target_reset() and only loop over failed commands.
> 
> Signed-off-by: Hannes Reinecke <hare@xxxxxxx>
> Reviewed-by: Christoph Hellwig <hch@xxxxxx>
> ---
>  drivers/scsi/scsi_error.c | 62 ++++++++++++++++-----------------------
>  1 file changed, 25 insertions(+), 37 deletions(-)
> 
> diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
> index 42e12756d6f4..7c9c376affda 100644
> --- a/drivers/scsi/scsi_error.c
> +++ b/drivers/scsi/scsi_error.c
> @@ -1716,43 +1715,32 @@ static int scsi_eh_bus_reset(struct Scsi_Host *shost,
> +		rtn = scsi_try_bus_reset(scmd);
> +		if (rtn != SUCCESS && rtn != FAST_IO_FAIL) {
>  			SCSI_LOG_ERROR_RECOVERY(3,
>  				shost_printk(KERN_INFO, shost,
>  					     "%s: BRST failed chan: %d\n",
>  					     current->comm, channel));
>  		}
> +		list_for_each_entry_safe(scmd, next, work_q, eh_entry) {

You probably want to iterate over the `tmp_list`, not the `work_q`.

> +			if (scmd_channel(scmd) != channel)
> +				continue;
> +

-- 
Best Regards, Benjamin Block        /        Linux on IBM Z Kernel Development
IBM Deutschland Research & Development GmbH    /   https://www.ibm.com/privacy
Vors. Aufs.-R.: Gregor Pillen         /         Geschäftsführung: David Faller
Sitz der Ges.: Böblingen     /    Registergericht: AmtsG Stuttgart, HRB 243294



[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