From: Brian King <brking@linux.vnet.ibm.com>
To: Christof Schmitt <christof.schmitt@de.ibm.com>
Cc: Mike Anderson <andmike@linux.vnet.ibm.com>, linux-scsi@vger.kernel.org
Subject: Re: eh_abort_handler and calling scsi_done
Date: Wed, 25 Mar 2009 08:52:50 -0500 [thread overview]
Message-ID: <49CA3732.2060508@linux.vnet.ibm.com> (raw)
In-Reply-To: <20090325085235.GA4214@schmichrtp.de.ibm.com>
Christof Schmitt wrote:
> 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.
No. There is no requirement to call scsi_done for aborted commands,
but there is also no harm in doing so.
-Brian
--
Brian King
Linux on Power Virtualization
IBM Linux Technology Center
prev parent reply other threads:[~2009-03-25 13: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
2009-03-25 13:52 ` Brian King [this message]
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=49CA3732.2060508@linux.vnet.ibm.com \
--to=brking@linux.vnet.ibm.com \
--cc=andmike@linux.vnet.ibm.com \
--cc=christof.schmitt@de.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.