I upgraded my kernel from 2.6.26-r1 to 2.6.27-r1 all the way to 2.6.26-r5 and when I do I am no longer able to mount my external USB hard drives. syslog-ng begins to go haywire filling /var/log/messages with the following:
Dec 12 19:39:47 MasterBox sd 9:0:0:0: [sdc] Sense Key : No Sense [current]
Dec 12 19:39:47 MasterBox sd 9:0:0:0: [sdc] Add. Sense: No additional sense information
This time around I enabled usb debug support, the full text is in the attachment. In addition I'm adding my kernel config.
Steps to Reproduce:
1.make clean && make && make modules_install && make install
2.Reboot to 2.6.27-r*
3.Turn on USB external drive
External device not recognized (no /dev/ made for it), tons of error messages dumped to /var/log/messages
Create device profile for external device (/dev/sdc1, 2)
Created attachment 175167 [details]
Messages about USB
First part is when I turn the device on, the second part is the constant loop
Created attachment 175169 [details]
Please attach complete logs from a few seconds after you plug the device in, and use "dmesg" to capture the logs rather than /var/log/messages
Dec 12 19:39:47 MasterBox usb-storage: Command READ_10 (10 bytes)
Dec 12 19:39:47 MasterBox usb-storage: 28 00 1d 1c 59 70 00 00 01 00
the buggy sector number is 488397168
Created attachment 175305 [details]
Last 200 lines of dmesg
I have a USB thumb drive in (/dev/sdc) and it still works, it might be in that report too.
(In reply to comment #4)
> according to
> Dec 12 19:39:47 MasterBox usb-storage: Command READ_10 (10 bytes)
> Dec 12 19:39:47 MasterBox usb-storage: 28 00 1d 1c 59 70 00 00 01 00
> the buggy sector number is 488397168
What has changed in the kernel that would allow a buggy sector to be ignored in an earlier release, and cause an infinite loop in a latter release?
In the mean time, should I run some vfat disk checks and try to fix these sectors?
(In reply to comment #5)
> Created an attachment (id=175305) 
> Last 200 lines of dmesg
That's not enough of the log, it doesn't capture when you plug the device in. If that wasn't the whole log, please post the whole thing. If that was the whole log, then you can increase CONFIG_LOG_BUF_SHIFT so that the logs are bigger, or you could wait a few fewer seconds before capturing the log.
Created attachment 175390 [details]
Dmesg during device start
This is what I captured before it went into the loop. I tried wait for as long as I could before I switched it off. I hope this helps.
This time, you got the start of the log (where the device is plugged in) but it is not long enough. We need to see what comes next, and the point when it enters the loop.
Please post larger logs. Just do this:
1. plug device in
2. Wait 8 seconds
4. dmesg > kernellog.txt
Then attach kernellog.txt here
Created attachment 175396 [details]
Okay, lets hope this is what you were looking for. I love shell scripts with a sleeper (don't know why I didn't think of it before).
Thanks, those logs now have all the information we need.
Sergey, do you want to work on this one?
Created attachment 175498 [details, diff]
Jason,try this patch please and let us now if it worked.
Also post this /proc/bus/usb/devices info please.
If you are interested,have a look at this bug http://bugs.gentoo.org/show_bug.cgi?id=250406 it has much in common with yours
Created attachment 175528 [details]
Final Dmesg Log
No loops in sight
Created attachment 175529 [details]
Thanks guys, that seemed to do the trick. The device is now loading without any loops happening. I posted my dmesg after the update, and the usb devices you requested.
Thanks! Reopening until we ship the fix in gentoo-sources
Sergey's patch was accepted upstream so I have queued it for future gentoo-sources releases.
Jason, to answer your earlier question, the problem here is that your device lies about it's capacity. It says it has 1 more sector than it actually has (a common fault in usb-storage hardware, a slight misinterpretation of the SCSI specs). Your device crashes when Linux tries to access the non-existent last sector. This has always been the case, but the difference is that 2.6.27 tries to read the last sector on plugin (to look for partition tables, RAID information, etc) whereas previously you would have had to fill the disk to get this to happen.
Fixed in gentoo-sources-2.6.27-r7
*** Bug 253034 has been marked as a duplicate of this bug. ***