From: Robert Hancock <hancockr@shaw.ca>
To: Robert Hancock <hancockr@shaw.ca>,
Alan Stern <stern@rowland.harvard.edu>,
usb-storage@lists.one-eyed-alien.net,
Tomas Styblo <tripie@cpan.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [usb-storage] [PATCH] JMicron JM20337 USB-SATA data corruption bugfix - device 152d:2338
Date: Wed, 30 Jul 2008 14:46:33 -0600 [thread overview]
Message-ID: <4890D329.80106@shaw.ca> (raw)
In-Reply-To: <20080730200033.GD7578@one-eyed-alien.net>
Matthew Dharm wrote:
> On Wed, Jul 30, 2008 at 01:55:25PM -0600, Robert Hancock wrote:
>> Alan Stern wrote:
>>> On Wed, 23 Jul 2008, Robert Hancock wrote:
>>>
>>>> It remains an issue, though, that if there's no underflow, if the device
>>>> reports an error in the CSW but doesn't provide sense data, we assume
>>>> nothing bad happened and don't retry. That definitely does not seem
>>>> correct. The device is not supposed to do this, but with how crappily
>>>> some of these devices are designed we should be more defensive.
>>> The problem is, what can you do? The device has said that something
>>> was wrong, but it hasn't told you what. Without knowing what went
>>> wrong, you can't know how to recover.
>
> Yes and no. If ASC/ASCQ is clear, then it's telling you that nothing is
> wrong. The device is contradicting itself. That doesn't really help us
> here, but it's a point I like to be clear on.
>
>>> I suppose in such cases we could simply report that the command failed
>>> completely.
>> I think that is what we need to do. The SCSI/block layers should retry
>> the command or report a failure to userspace. Above all else we can't
>> just continue on our merry way and assume success, otherwise data will
>> get silently corrupted.
>
> The code path to supress the reporting of an error when auto-sense shows no
> ASC/ASCQ was added for a reason. That reason has likely been lost to time,
> but I worry about devices that are out there that rely on the current
> behavior to function properly....
My original comment was that that code should be removed, but this is
incorrect. In fact that code path is unrelated to this problem since it
only executes if no transport error was detected. This code path is
needed since retrieving sense data is done for multiple reasons other
than a transport failure. For one, "If we're running the CB transport,
which is incapable of determining status on its own, we will auto-sense
unless the operation involved a data-in transfer." In this case, for a
successful transfer the status must be reset to good after getting the
sense data.
In the case in question here, the BOT transport reports a failure, and
we retrieve sense data, but the sense data doesn't indicate an error.
This results in the failure essentially being ignored. In this case I
think we should be doing the same thing as we do on detecting an underflow:
srb->result = (DID_ERROR << 16) | (SUGGEST_RETRY << 24);
next prev parent reply other threads:[~2008-07-30 20:46 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <fa.eWQqoO1e4Mdhu8SK5jzMFAI/3NU@ifi.uio.no>
2008-07-21 19:37 ` [PATCH] JMicron JM20337 USB-SATA data corruption bugfix - device 152d:2338 Robert Hancock
2008-07-22 2:37 ` Alan Stern
2008-07-22 9:03 ` Tomas Styblo
2008-07-23 2:38 ` Alan Stern
2008-07-23 23:20 ` Robert Hancock
2008-07-24 3:42 ` Alan Stern
2008-07-30 19:55 ` Robert Hancock
2008-07-30 20:00 ` [usb-storage] " Matthew Dharm
2008-07-30 20:46 ` Robert Hancock [this message]
2008-07-30 21:18 ` Alan Stern
2008-07-30 21:07 ` Alan Stern
2008-08-01 21:15 ` Alex Buell
2008-08-01 22:22 ` Alex Buell
2008-08-02 2:32 ` Robert Hancock
2008-08-02 23:49 ` Alan Stern
2008-08-03 9:07 ` Alex Buell
2008-08-04 16:48 ` Alan Stern
2008-08-04 20:17 ` Alex Buell
2008-08-04 20:45 ` Alan Stern
2008-09-02 12:10 ` Thiago Galesi
2008-09-02 15:02 ` Alan Stern
2008-09-02 16:07 ` Thiago Galesi
2008-09-02 19:19 ` Alan Stern
2008-09-02 20:16 ` Thiago Galesi
2008-09-02 21:06 ` Alan Stern
2008-09-04 12:09 ` Thiago Galesi
2008-09-04 14:03 ` Alan Stern
2008-09-04 15:17 ` Thiago Galesi
2008-09-04 15:26 ` Alan Stern
2008-07-25 8:44 ` Tomas Styblo
2008-07-25 8:54 ` Robert Hancock
2008-07-22 5:11 ` Tomas Styblo
2008-07-22 5:31 ` Robert Hancock
2008-07-22 6:11 ` Tomas Styblo
2008-07-22 8:45 ` Robert Hancock
2008-07-24 6:15 ` Alex Buell
2008-07-29 21:09 ` Alex Buell
2008-07-29 22:33 ` [usb-storage] " Matthew Dharm
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=4890D329.80106@shaw.ca \
--to=hancockr@shaw.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
--cc=tripie@cpan.org \
--cc=usb-storage@lists.one-eyed-alien.net \
/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