public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Swen Schillig <swen.schillig@googlemail.com>
To: linux-scsi@vger.kernel.org
Cc: James.Bottomley@suse.de
Subject: [RFC] let LLD handle bsg_job_timeout
Date: Thu, 10 Dec 2009 09:45:23 +0100	[thread overview]
Message-ID: <1260434723.2955.25.camel@localhost.localdomain> (raw)

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);
 	}
 



             reply	other threads:[~2009-12-10  8:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-10  8:45 Swen Schillig [this message]
2010-01-04 13:36 ` [RFC] let LLD handle bsg_job_timeout Swen Schillig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1260434723.2955.25.camel@localhost.localdomain \
    --to=swen.schillig@googlemail.com \
    --cc=James.Bottomley@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox