From: Rogier Wolff <R.E.Wolff@BitWizard.nl>
To: usb-storage@lists.one-eyed-alien.net,
linux-usb-devel@lists.sourceforge.net,
mdharm-usb@one-eyed-alien.net, linux-scsi@vger.kernel.org
Subject: Errors on USB-storage device are ignored.
Date: Thu, 16 Aug 2007 16:58:17 +0200 [thread overview]
Message-ID: <20070816145817.GA24105@bitwizard.nl> (raw)
Hi,
I have an usb-storage enclosure that houses a normal desktop
harddrive. I have been wondering why disks in that enclosure
seemed to be having less errors than when connected to a
normal IDE connector.
The reason is: USB-storage is ignoring a hint that something is
wrong. Probably my enclosure is also not completely following specs,
but Linux is ignoring the hint as well....
On hitting a bad block, the disk reports error. The USB converter
then reports "auto-sense-required", and this is carried out. However
at this point, my USB enclosure returns all-zeroes. This is
considered non-fatal by the kernel.
I'm guessing not many people are testing these things with
bad drives. So, I don't know wether or not other USB converters
handle this situation more gracefully.
As a patch, I've decided to set the sense key to "vendor specific"
(9), and then no "additional sense" (0:0), if, and only if the device
didn't return any valid sense info.
The rest of the kernel then correctly interprets the situation
as an IO error.
Roger Wolff.
--- linux-2.6.20.3.clean/drivers/usb/storage/transport.c 2007-03-13 19:27:08.000000000 +0100
+++ linux-2.6.20.3.kostunrix/drivers/usb/storage/transport.c 2007-08-16 16:47:00.000000000 +0200
@@ -629,6 +629,14 @@
/* let's clean up right away */
memcpy(srb->sense_buffer, us->sensebuf, US_SENSE_SIZE);
+ if (((srb->sense_buffer[2]&0xf) == 0) &&
+ (srb->sense_buffer[12] == 0) &&
+ (srb->sense_buffer[13] == 0)) {
+ /* Hmmmmm. The device requested sense, but then
+ declined to give us more info.... -- REW */
+ srb->sense_buffer[2] |= 0x09; /* Vendor specific */
+ }
+
srb->resid = old_resid;
srb->request_buffer = old_request_buffer;
srb->request_bufflen = old_request_bufflen;
--
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2600998 **
** Delftechpark 26 2628 XH Delft, The Netherlands. KVK: 27239233 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
Q: It doesn't work. A: Look buddy, doesn't work is an ambiguous statement.
Does it sit on the couch all day? Is it unemployed? Please be specific!
Define 'it' and what it isn't doing. --------- Adapted from lxrbot FAQ
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
next reply other threads:[~2007-08-16 14:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-16 14:58 Rogier Wolff [this message]
2007-08-20 6:09 ` Errors on USB-storage device are ignored Matthew Dharm
2007-08-20 8:37 ` Rogier Wolff
2007-08-20 13:03 ` James Bottomley
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=20070816145817.GA24105@bitwizard.nl \
--to=r.e.wolff@bitwizard.nl \
--cc=linux-scsi@vger.kernel.org \
--cc=linux-usb-devel@lists.sourceforge.net \
--cc=mdharm-usb@one-eyed-alien.net \
--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 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.