From: Mike Christie <michaelc@cs.wisc.edu>
To: scameron@beardog.cce.hp.com
Cc: linux-scsi@vger.kernel.org
Subject: Re: Question about aborting commands
Date: Thu, 26 May 2011 17:56:09 -0500 [thread overview]
Message-ID: <4DDEDA89.3090303@cs.wisc.edu> (raw)
In-Reply-To: <20110525202411.GO26570@beardog.cce.hp.com>
On 05/25/2011 03:24 PM, scameron@beardog.cce.hp.com wrote:
>> Le 25 mai 2011 06:50, <scameron@beardog.cce.hp.com> a écrit :
>>> Or, maybe I should be reporting the CMD_ABORTED case back as
>>>
>>> cmd->result = DID_SOFT_ERROR << 16;
>>
>> look at scsi_error.c:scsi_decide_disposition(). DID_SOFT_ERROR
>> triggers retry handling while DID_ABORT does not (at least in the tree
>> that i'm looking at).
>>
>
> Yes this is what I was looking at, and part of what is confusing me.
> This makes me think that DID_ABORT is the wrong thing to do, because
> it would seem that there is no retry, and yet, dd does not complain
> that one of the reads initiated on it's behalf has been aborted.
> Does that mean it copied bogus data (uninitialized memory)? Not sure,
> but if so, that would be bad. (Easy enough to test this case.)
scsi_decide_disposition is not used in the abort path. In the abort path
commands go through scsi_eh_flush_done_q. In there you can see some
basic handling. We check if we can failfast the cmd (scsi_noretry_cmd)
and if there are enough retries. If it is not fastfailbale and there are
enough retries we retry the IO by calling scsi_queue_insert.
If there are not enough retries or we want to fastfail it then
scsi_finish_command is called like is done in the normal completion path
from (scsi_softirq_done -> scsi_decide_disposition -> (look at return
value) -> scsi_finish_command.
From scsi_finish_command the cmd is then handled like in the normal path
where something like the ULD done function is called then
scsi_io_completion is.
So as you can see from scsi_eh_flush_done_q, the scsi layer does not
really look at what you return and do anything with it. There is just
the basic check for if the IO is fastfailable. When I added that code,
it looked like most drivers returned a wide range of values and in some
cases did not return anything (if a driver does not set anything for the
result then there is that check in scsi_eh_flush_done_q that sets the
DRIVER_TIMEOUT bit).
I do not know what the policy is. I have been converting drivers to
return something useful when they want to control if IO is fastfailed in
this path.
--
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
prev parent reply other threads:[~2011-05-26 22:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-25 13:50 Question about aborting commands scameron
2011-05-25 18:57 ` Peter Chang
2011-05-25 20:24 ` scameron
2011-05-26 22:56 ` Mike Christie [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=4DDEDA89.3090303@cs.wisc.edu \
--to=michaelc@cs.wisc.edu \
--cc=linux-scsi@vger.kernel.org \
--cc=scameron@beardog.cce.hp.com \
/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;
as well as URLs for NNTP newsgroup(s).