linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] let LLD handle bsg_job_timeout
@ 2009-12-10  8:45 Swen Schillig
  2010-01-04 13:36 ` Swen Schillig
  0 siblings, 1 reply; 2+ messages in thread
From: Swen Schillig @ 2009-12-10  8:45 UTC (permalink / raw)
  To: linux-scsi; +Cc: James.Bottomley

The current fc_bsg_job_timeout function offers 
only two possibilities to a LLD to deal with timed out requests.
Either you deal with it offering a callback or not, 
in both scenarios the environment is cleaned up afterwards.

Unfortunately we (zfcp) don't have the option
to easily abort a request. Our hardware is running its 
own timer taking care of requests but unfortunately our only chance is
to wait until we receive a response. Up until then we need
the environment because the hardware might write into the provided
buffers.

The following code snippet would solve the issue for us
but maybe someone has a better idea on how to deal with the
described situation.

Cheers Swen
---
 drivers/scsi/scsi_transport_fc.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Index: HEAD/drivers/scsi/scsi_transport_fc.c
===================================================================
--- HEAD.orig/drivers/scsi/scsi_transport_fc.c
+++ HEAD/drivers/scsi/scsi_transport_fc.c
@@ -3500,7 +3500,10 @@ fc_bsg_job_timeout(struct request *req)
 	if (!done && i->f->bsg_timeout) {
 		/* call LLDD to abort the i/o as it has timed out */
 		err = i->f->bsg_timeout(job);
-		if (err)
+		if (err == -EAGAIN) {
+			job->ref_cnt--;
+			return BLK_EH_RESET_TIMER;
+		} else if (err)
 			printk(KERN_ERR "ERROR: FC BSG request timeout - LLD "
 				"abort failed with status %d\n", err);
 	}
 



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

* Re: [RFC] let LLD handle bsg_job_timeout
  2009-12-10  8:45 [RFC] let LLD handle bsg_job_timeout Swen Schillig
@ 2010-01-04 13:36 ` Swen Schillig
  0 siblings, 0 replies; 2+ messages in thread
From: Swen Schillig @ 2010-01-04 13:36 UTC (permalink / raw)
  To: linux-scsi, James.Smart

James

unfortunately I posted below RFC not to you but to James B.
Anyhow, it appeared on the SCSI list, have you read it by accident ?

Could you give me an idea whether the suggested change is an option ?

Thanks in advance.
Swen

On Thu, 2009-12-10 at 09:45 +0100, Swen Schillig wrote:
> The current fc_bsg_job_timeout function offers 
> only two possibilities to a LLD to deal with timed out requests.
> Either you deal with it offering a callback or not, 
> in both scenarios the environment is cleaned up afterwards.
> 
> Unfortunately we (zfcp) don't have the option
> to easily abort a request. Our hardware is running its 
> own timer taking care of requests but unfortunately our only chance is
> to wait until we receive a response. Up until then we need
> the environment because the hardware might write into the provided
> buffers.
> 
> The following code snippet would solve the issue for us
> but maybe someone has a better idea on how to deal with the
> described situation.
> 
> Cheers Swen
> ---
>  drivers/scsi/scsi_transport_fc.c |    7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> Index: HEAD/drivers/scsi/scsi_transport_fc.c
> ===================================================================
> --- HEAD.orig/drivers/scsi/scsi_transport_fc.c
> +++ HEAD/drivers/scsi/scsi_transport_fc.c
> @@ -3500,7 +3500,10 @@ fc_bsg_job_timeout(struct request *req)
>  	if (!done && i->f->bsg_timeout) {
>  		/* call LLDD to abort the i/o as it has timed out */
>  		err = i->f->bsg_timeout(job);
> -		if (err)
> +		if (err == -EAGAIN) {
> +			job->ref_cnt--;
> +			return BLK_EH_RESET_TIMER;
> +		} else if (err)
>  			printk(KERN_ERR "ERROR: FC BSG request timeout - LLD "
>  				"abort failed with status %d\n", err);
>  	}
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



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

end of thread, other threads:[~2010-01-04 13:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-10  8:45 [RFC] let LLD handle bsg_job_timeout Swen Schillig
2010-01-04 13:36 ` Swen Schillig

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).