Re: [PATCHv5 8/8] scsi: inline command aborts

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

 



I think this also need to remove the abort_work field from
struct scsi_cmnd.

>  }
>  
>  #ifdef CONFIG_SCSI_LOGGING
> diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
> index 53e3343..2355100 100644
> --- a/drivers/scsi/scsi_error.c
> +++ b/drivers/scsi/scsi_error.c
> @@ -115,11 +115,9 @@ static int scsi_host_eh_past_deadline(struct Scsi_Host *shost)
>   * scmd_eh_abort_handler - Handle command aborts
>   * @work:	command to be aborted.
>   */
> -void
> -scmd_eh_abort_handler(struct work_struct *work)
> +int
> +scmd_eh_abort_handler(struct scsi_cmnd *scmd)
>  {
> -	struct scsi_cmnd *scmd =
> -		container_of(work, struct scsi_cmnd, abort_work.work);
>  	struct scsi_device *sdev = scmd->device;
>  	int rtn;
>  
> @@ -127,42 +125,40 @@ static int scsi_host_eh_past_deadline(struct Scsi_Host *shost)
>  		SCSI_LOG_ERROR_RECOVERY(3,
>  			scmd_printk(KERN_INFO, scmd,
>  				    "eh timeout, not aborting\n"));
> -	} else {
> -		SCSI_LOG_ERROR_RECOVERY(3,
> -			scmd_printk(KERN_INFO, scmd,
> -				    "aborting command\n"));
> -		rtn = scsi_try_to_abort_cmd(sdev->host->hostt, scmd);
> -		if (rtn == SUCCESS) {
> -			set_host_byte(scmd, DID_TIME_OUT);
> -			if (scsi_host_eh_past_deadline(sdev->host)) {
> -				SCSI_LOG_ERROR_RECOVERY(3,
> -					scmd_printk(KERN_INFO, scmd,
> -						    "eh timeout, not retrying "
> -						    "aborted command\n"));
> -			} else if (!scsi_noretry_cmd(scmd) &&
> -			    (++scmd->retries <= scmd->allowed)) {
> -				SCSI_LOG_ERROR_RECOVERY(3,
> -					scmd_printk(KERN_WARNING, scmd,
> -						    "retry aborted command\n"));
> -				scsi_queue_insert(scmd, SCSI_MLQUEUE_EH_RETRY);
> -				return;
> -			} else {
> -				SCSI_LOG_ERROR_RECOVERY(3,
> -					scmd_printk(KERN_WARNING, scmd,
> -						    "finish aborted command\n"));
> -				scsi_finish_command(scmd);
> -				return;
> -			}
> -		} else {
> +		return FAILED;
> +	}
> +	SCSI_LOG_ERROR_RECOVERY(3,
> +		scmd_printk(KERN_INFO, scmd,
> +			    "aborting command\n"));
> +	rtn = scsi_try_to_abort_cmd(sdev->host->hostt, scmd);
> +	if (rtn == SUCCESS) {

If you restructure the function anywat this could become an
early return / goto out.




[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