linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ibmvscsis: Fix srp_transfer_data fail return code
@ 2017-01-09 16:21 Bryant G. Ly
  2017-01-09 16:47 ` Greg KH
  2017-01-10 17:36 ` Bart Van Assche
  0 siblings, 2 replies; 5+ messages in thread
From: Bryant G. Ly @ 2017-01-09 16:21 UTC (permalink / raw)
  To: gregkh
  Cc: nab, jejb, martin.petersen, Bart.VanAssche, linux-scsi,
	target-devel, linux-kernel, stable, Bryant G. Ly

From: "Bryant G. Ly" <bgly@us.ibm.com>

If srp_transfer_data fails within ibmvscsis_write_pending, then
the most likely scenario is that the client timed out the op and
removed the TCE mapping. Thus it will loop forever retrying the
op that is pretty much guaranteed to fail forever. A better return
code would be EIO instead of EAGAIN.

Cc: stable@vger.kernel.org
Reported-by: Steven Royer <seroyer@linux.vnet.ibm.com>
Tested-by: Steven Royer <seroyer@linux.vnet.ibm.com>
Signed-off-by: Bryant G. Ly <bgly@us.ibm.com>
---
 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
index 3d3768a..8fb5c54 100644
--- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
+++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
@@ -3585,7 +3585,7 @@ static int ibmvscsis_write_pending(struct se_cmd *se_cmd)
 			       1, 1);
 	if (rc) {
 		pr_err("srp_transfer_data() failed: %d\n", rc);
-		return -EAGAIN;
+		return -EIO;
 	}
 	/*
 	 * We now tell TCM to add this WRITE CDB directly into the TCM storage
-- 
2.5.4 (Apple Git-61)

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] ibmvscsis: Fix srp_transfer_data fail return code
  2017-01-09 16:21 [PATCH] ibmvscsis: Fix srp_transfer_data fail return code Bryant G. Ly
@ 2017-01-09 16:47 ` Greg KH
  2017-01-09 17:23   ` Bryant G. Ly
  2017-01-10 17:36 ` Bart Van Assche
  1 sibling, 1 reply; 5+ messages in thread
From: Greg KH @ 2017-01-09 16:47 UTC (permalink / raw)
  To: Bryant G. Ly
  Cc: nab, jejb, martin.petersen, Bart.VanAssche, linux-scsi,
	target-devel, linux-kernel, stable, Bryant G. Ly

On Mon, Jan 09, 2017 at 10:21:20AM -0600, Bryant G. Ly wrote:
> From: "Bryant G. Ly" <bgly@us.ibm.com>
> 
> If srp_transfer_data fails within ibmvscsis_write_pending, then
> the most likely scenario is that the client timed out the op and
> removed the TCE mapping. Thus it will loop forever retrying the
> op that is pretty much guaranteed to fail forever. A better return
> code would be EIO instead of EAGAIN.
> 
> Cc: stable@vger.kernel.org
> Reported-by: Steven Royer <seroyer@linux.vnet.ibm.com>
> Tested-by: Steven Royer <seroyer@linux.vnet.ibm.com>
> Signed-off-by: Bryant G. Ly <bgly@us.ibm.com>
> ---
>  drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Why are you sending this to me?

confused,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ibmvscsis: Fix srp_transfer_data fail return code
  2017-01-09 16:47 ` Greg KH
@ 2017-01-09 17:23   ` Bryant G. Ly
  2017-01-09 17:55     ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Bryant G. Ly @ 2017-01-09 17:23 UTC (permalink / raw)
  To: Greg KH
  Cc: nab, jejb, martin.petersen, Bart.VanAssche, linux-scsi,
	target-devel, linux-kernel, stable, Bryant G. Ly

On 1/9/17 10:47 AM, Greg KH wrote:

> On Mon, Jan 09, 2017 at 10:21:20AM -0600, Bryant G. Ly wrote:
>> From: "Bryant G. Ly" <bgly@us.ibm.com>
>>
>> If srp_transfer_data fails within ibmvscsis_write_pending, then
>> the most likely scenario is that the client timed out the op and
>> removed the TCE mapping. Thus it will loop forever retrying the
>> op that is pretty much guaranteed to fail forever. A better return
>> code would be EIO instead of EAGAIN.
>>
>> Cc: stable@vger.kernel.org
>> Reported-by: Steven Royer <seroyer@linux.vnet.ibm.com>
>> Tested-by: Steven Royer <seroyer@linux.vnet.ibm.com>
>> Signed-off-by: Bryant G. Ly <bgly@us.ibm.com>
>> ---
>>   drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
> Why are you sending this to me?
>
> confused,
>
> greg k-h
Sorry I meant to put --to target-devel@vger.kernel.org, and just --cc you.

-Bryant

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ibmvscsis: Fix srp_transfer_data fail return code
  2017-01-09 17:23   ` Bryant G. Ly
@ 2017-01-09 17:55     ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2017-01-09 17:55 UTC (permalink / raw)
  To: Bryant G. Ly
  Cc: nab, jejb, martin.petersen, Bart.VanAssche, linux-scsi,
	target-devel, linux-kernel, stable, Bryant G. Ly

On Mon, Jan 09, 2017 at 11:23:23AM -0600, Bryant G. Ly wrote:
> On 1/9/17 10:47 AM, Greg KH wrote:
> 
> > On Mon, Jan 09, 2017 at 10:21:20AM -0600, Bryant G. Ly wrote:
> > > From: "Bryant G. Ly" <bgly@us.ibm.com>
> > > 
> > > If srp_transfer_data fails within ibmvscsis_write_pending, then
> > > the most likely scenario is that the client timed out the op and
> > > removed the TCE mapping. Thus it will loop forever retrying the
> > > op that is pretty much guaranteed to fail forever. A better return
> > > code would be EIO instead of EAGAIN.
> > > 
> > > Cc: stable@vger.kernel.org
> > > Reported-by: Steven Royer <seroyer@linux.vnet.ibm.com>
> > > Tested-by: Steven Royer <seroyer@linux.vnet.ibm.com>
> > > Signed-off-by: Bryant G. Ly <bgly@us.ibm.com>
> > > ---
> > >   drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > Why are you sending this to me?
> > 
> > confused,
> > 
> > greg k-h
> Sorry I meant to put --to target-devel@vger.kernel.org, and just --cc you.

Why even cc: me?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ibmvscsis: Fix srp_transfer_data fail return code
  2017-01-09 16:21 [PATCH] ibmvscsis: Fix srp_transfer_data fail return code Bryant G. Ly
  2017-01-09 16:47 ` Greg KH
@ 2017-01-10 17:36 ` Bart Van Assche
  1 sibling, 0 replies; 5+ messages in thread
From: Bart Van Assche @ 2017-01-10 17:36 UTC (permalink / raw)
  To: bryantly
  Cc: jejb, linux-scsi, linux-kernel, bgly, target-devel, martin.petersen, nab

On Mon, 2017-01-09 at 10:21 -0600, Bryant G. Ly wrote:
> From: "Bryant G. Ly" <bgly@us.ibm.com>
> 
> If srp_transfer_data fails within ibmvscsis_write_pending, then
> the most likely scenario is that the client timed out the op and
> removed the TCE mapping. Thus it will loop forever retrying the
> op that is pretty much guaranteed to fail forever. A better return
> code would be EIO instead of EAGAIN.
> 
> Cc: stable@vger.kernel.org
> Reported-by: Steven Royer <seroyer@linux.vnet.ibm.com>
> Tested-by: Steven Royer <seroyer@linux.vnet.ibm.com>
> Signed-off-by: Bryant G. Ly <bgly@us.ibm.com>
> ---
>  drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
> index 3d3768a..8fb5c54 100644
> --- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
> +++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
> @@ -3585,7 +3585,7 @@ static int ibmvscsis_write_pending(struct se_cmd *se_cmd)
>  			       1, 1);
>  	if (rc) {
>  		pr_err("srp_transfer_data() failed: %d\n", rc);
> -		return -EAGAIN;
> +		return -EIO;
>  	}
>  	/*
>  	 * We now tell TCM to add this WRITE CDB directly into the TCM storage

Using the "Cc: stable@vger.kernel.org" tag is fine but please do not
add stable@vger.kernel.org to the CC-list of the e-mail header. Anyway,
thanks for the patch. It has been applied on my for-v4.10 branch.

Bart.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-01-10 17:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-09 16:21 [PATCH] ibmvscsis: Fix srp_transfer_data fail return code Bryant G. Ly
2017-01-09 16:47 ` Greg KH
2017-01-09 17:23   ` Bryant G. Ly
2017-01-09 17:55     ` Greg KH
2017-01-10 17:36 ` Bart Van Assche

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).