public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Christof Schmitt <christof.schmitt@de.ibm.com>
To: Mike Anderson <andmike@linux.vnet.ibm.com>
Cc: Brian King <brking@linux.vnet.ibm.com>, linux-scsi@vger.kernel.org
Subject: Re: eh_abort_handler and calling scsi_done
Date: Wed, 25 Mar 2009 09:52:35 +0100	[thread overview]
Message-ID: <20090325085235.GA4214@schmichrtp.de.ibm.com> (raw)
In-Reply-To: <20090324174609.GA13556@linux.vnet.ibm.com>

On Tue, Mar 24, 2009 at 10:46:09AM -0700, Mike Anderson wrote:
> Brian King <brking@linux.vnet.ibm.com> wrote:
> > Your assessment sounds correct to me. The other caveat to note is that
> > if for some reason in your eh_abort_handler you don't think the command
> > is still outstanding, you should return SUCCESS for this as well.
> > 
> > -Brian
> > 
> > Christof Schmitt wrote:
> > > I am investigating what is required from a LLD when SCSI commands time
> > > out and the SCSI EH calls the eh_abort_handler. The documentation in
> > > scsi_eh.txt states:
> > > 
> > >     <<scsi_eh_abort_cmds>>
> > > 
> > > 	This action is taken for each timed out command.
> > > 	hostt->eh_abort_handler() is invoked for each scmd.  The
> > > 	handler returns SUCCESS if it has succeeded to make LLDD and
> > > 	all related hardware forget about the scmd.
> > > 
> > > From this and from looking at the code, i would conclude:
> > > 
> > > 1) If the LLD returns FAILED from the eh_abort_handler, then the
> > >    command is still allowed to be active in the LLD and the LLD can
> > >    call scsi_done any time later (probably latest when the
> > >    eh_host_reset_handler flushes everything that is still pending).
> > > 
> > > 2) While the abort is pending, but before returning SUCCESS from
> > >    eh_abort_handler, the LLD can still call scsi_done for the SCSI
> > >    command to be aborted (the SCSI command might be returned with a
> > >    status "aborted" if the abort succeeds, or "good" if it was
> > >    completed just before the abort reached the storage system).
> > > 
> 
> In cases 1 and 2 above calling scsi_done can be done but will cause
> the request to be stopped in blk_complete_request
> (scsi_done->blk_complete_request) as the timed out handler has
> already taken ownership of the command.

I am not too familiar with the blk completion handling. Would calling
scsi_done for the cases above cause any problems? If there are reasons
not to call scsi_done here, then this could be mentioned in the scsi
documentation file.

--
Christof Schmitt

  reply	other threads:[~2009-03-25  8:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-24 11:41 eh_abort_handler and calling scsi_done Christof Schmitt
2009-03-24 13:29 ` Brian King
2009-03-24 14:34   ` Christof Schmitt
2009-03-24 17:46   ` Mike Anderson
2009-03-25  8:52     ` Christof Schmitt [this message]
2009-03-25 13:52       ` Brian King

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=20090325085235.GA4214@schmichrtp.de.ibm.com \
    --to=christof.schmitt@de.ibm.com \
    --cc=andmike@linux.vnet.ibm.com \
    --cc=brking@linux.vnet.ibm.com \
    --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