Re: [PATCH 5/9] scsi: set host byte after EH completed

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

 



On 10/16/23 7:15 AM, Hannes Reinecke wrote:
> @@ -1671,7 +1682,8 @@ static int scsi_eh_target_reset(struct Scsi_Host *shost,
>  			if (rtn == SUCCESS)
>  				list_move_tail(&scmd->eh_entry, &check_list);
>  			else if (rtn == FAST_IO_FAIL)
> -				scsi_eh_finish_cmd(scmd, done_q);
> +				__scsi_eh_finish_cmd(scmd, done_q,
> +						     DID_TRANSPORT_DISRUPTED);
>  			else
>  				/* push back on work queue for further processing */
>  				list_move(&scmd->eh_entry, work_q);
> @@ -1736,8 +1748,9 @@ static int scsi_eh_bus_reset(struct Scsi_Host *shost,
>  			list_for_each_entry_safe(scmd, next, work_q, eh_entry) {
>  				if (channel == scmd_channel(scmd)) {
>  					if (rtn == FAST_IO_FAIL)
> -						scsi_eh_finish_cmd(scmd,
> -								   done_q);
> +						__scsi_eh_finish_cmd(scmd,
> +								     done_q,
> +								     DID_TRANSPORT_DISRUPTED);
>  					else
>  						list_move_tail(&scmd->eh_entry,
>  							       &check_list);
> @@ -1780,9 +1793,9 @@ static int scsi_eh_host_reset(struct Scsi_Host *shost,
>  		if (rtn == SUCCESS) {
>  			list_splice_init(work_q, &check_list);
>  		} else if (rtn == FAST_IO_FAIL) {
> -			list_for_each_entry_safe(scmd, next, work_q, eh_entry) {
> -					scsi_eh_finish_cmd(scmd, done_q);
> -			}
> +			list_for_each_entry_safe(scmd, next, work_q, eh_entry)
> +				__scsi_eh_finish_cmd(scmd, done_q,
> +						     DID_TRANSPORT_DISRUPTED);
>  		} else {
>  			SCSI_LOG_ERROR_RECOVERY(3,
>  				shost_printk(KERN_INFO, shost,

For FAST_IO_FAIL I think you want to use DID_TRANSPORT_FAILFAST  because when
drivers return that, they normally have hit their fast io fail timer or have
hit a hard transport issue like the port is offline. For example for FC drivers
they do:

err = fc_block_rport(rport);
if (err)
	return err;
 
where fc_block_rport does:

if (rport->flags & FC_RPORT_FAST_FAIL_TIMEDOUT)
	return FAST_IO_FAIL;

and then for fc_remote_port_chkready we return DID_TRANSPORT_FAILFAST
when FC_RPORT_FAST_FAIL_TIMEDOUT is set.

So using DID_TRANSPORT_FAILFAST would align the return values for that
state.

One question I had is why you added those checks for target and host
reset but not scsi_eh_bus_device_reset because drivers will do something
similar to above where they call fc_block_rport for that callout as
well.





[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