Re: [PATCH RESEND] libiscsi: Don't retry if xmit_task return a non-transient error code

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

 



On 08/17/2014 10:23 AM, Sagi Grimberg wrote:
> Allow transport callback xmit_task to return a non-transient
> error code -EINVAL to inform us not to retry the task. For any
> other error code keep the current retry behavior.
> 
> Signed-off-by: Sagi Grimberg <sagig@xxxxxxxxxxxx>
> ---
>  drivers/scsi/libiscsi.c |   13 ++++++++++---
>  1 files changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
> index 3d1bc67..03768a9 100644
> --- a/drivers/scsi/libiscsi.c
> +++ b/drivers/scsi/libiscsi.c
> @@ -1722,10 +1722,17 @@ int iscsi_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc)
>  				goto prepd_fault;
>  			}
>  		}
> -		if (session->tt->xmit_task(task)) {
> +
> +		reason = session->tt->xmit_task(task);
> +		if (reason) {
>  			session->cmdsn--;
> -			reason = FAILURE_SESSION_NOT_READY;
> -			goto prepd_reject;
> +			if (reason == -EINVAL) {
> +				sc->result = DID_ABORT << 16;
> +				goto prepd_fault;
> +			} else {
> +				reason = FAILURE_SESSION_NOT_READY;
> +				goto prepd_reject;
> +			}
>  		}
>  	} else {
>  		list_add_tail(&task->running, &conn->cmdqueue);
> 

Looks ok to me.

Acked-by: Mike Christie <michaelc@xxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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