Red Hat Bugzilla – Bug 145256
INQUIRY commands crash many USB storage devices
Last modified: 2013-03-05 22:42:40 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5)
Description of problem:
When using my Sandisk cruzer mini HAL crashes USB storage at times.
According to Allen Stern ( linux USB storage developer) HAL is sending
INQUIRY commands of 255 bytes when it should send 36 bytes, this
crashes USB storage.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.plugin Sandisk cruzer mini
2.wait for icon to appear on desktop
Actual Results: USB storage fails
Expected Results: contents of Sandisk crizer mini should be available
> When using my Sandisk cruzer mini HAL crashes USB storage at times.
> According to Allen Stern ( linux USB storage developer) HAL is sending
> INQUIRY commands of 255 bytes when it should send 36 bytes, this
> crashes USB storage.
HAL doesn't send INQUIRY commands, it simply uses open(2), read(2)
etc. on the device file. What you're seeing is a defect with the
either the usb-storage driver or the SCSI midlayer, not with hald.
David is absolutely wrong about where the defect lies. Opening a SCSI
disk device file (like /dev/sda or /dev/sda1) does _not_ cause any of
the SCSI layers, including usb-storage, to send an INQUIRY command. I
have used a separate program many times to open(2) and read(2) device
files in this way; the only commands generated are TEST UNIT READY,
PREVENT MEDIUM REMOVAL, and READ(10). The INQUIRY command must be
generated somewhere else, outside the kernel.
Now, it might not be generated by hald. It might come from a program
or a library invoked by hald (or even from somewhere else entirely,
although that seems unlikely since Steve says his problem stops when
hald isn't running).
Unfortunately I can't test this easily on my system. hald crashes
soon after starting with a segmentation violation when it tries
handling one of the USB buses.
I stand corrected; after more thourough inspection of the code we do
indeed send a INQUIRY for attempting to read the drive_id off page
0x80. I will investigate this issue and provide some packages for testing.
Thanks for the notice and sorry for initially dismissing this bug.
Please try out these packages
which should contain the fix for this.
The above packages appear to have fixed the USB storage issue, on an
unrelated concern I'm having problems with hald dying/sleeping after
my machine has been up and running for an hour or more, would you like
me to continue on this bug report or open a new one? Steve
Please open a new bug report for the other issue. Thanks, David.