[Bug 237446] New: kernel reports too-small size for usb-attached hard disk (usb-storage)
https://bugzilla.novell.com/show_bug.cgi?id=237446 Summary: kernel reports too-small size for usb-attached hard disk (usb-storage) Product: openSUSE 10.2 Version: Final Platform: i586 OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Kernel AssignedTo: kernel-maintainers@forge.provo.novell.com ReportedBy: ag@pre-secure.de QAContact: qa@suse.de I use a 2,5" harddisk (Hitachi Travelstar E5K100) in an external usb-case. when i use that disk via usb-storage under opensuse 10.2, the kernel reports the size of that hardisk exactly one 512byte-sector too short. according to the specification, the disk should have 40,007,761,920 byes, but fdisk reports Disk /dev/sdb: 40.0 GB, 40007761408 bytes 255 heads, 63 sectors/track, 4863 cylinders which is exactly 512 byes less than the specification. the same error for opensuse 10.1 if i attach that same disk via IDE or firewire on the same system, it works correctly, and fdisdk reports: Disk /dev/hda: 40.0 GB, 40007761920 bytes 255 heads, 63 sectors/track, 4864 cylinders which is the correct number of bytes. also, if i attach that harddisk via usb on an opensuse 10.0 system, fdisk also reports the correct number of bytes. i tried two different USB<->ATA converters (one with a prolific PL-3507 chip, the other one with a datastor usb4500) and both give the same effect. if i fully partition the hard disk that sees the correct size and then insert it via usb on a system that sees one sector less, i get, not very surprisingly, i/o errors when the kernel is trying to access the end of the partition. since this bug shows up in 10.1 and 10.2 independently of system-hardware and the type of usb-ata-converter i use, this somehow smells like a bug in the usb_storage module. but i am by far now kernel expert... the opensuse 10.1 and 10.2 systems where usb did not work correctly (but ide and firewire did) were EPIA-EN12000 (http://www.via.com.tw/en/products/mainboards/motherboards.jsp?motherboard_id...) based systems. the opensuse 10.0 system where it worked was a thinkpa T41p. kernel versions: 10.2 2.6.18.2-34-default 10.1 2.6.16.27-0.6-default 10.0 2.6.13-15.13-default all three systems are fairly standard opensuse system with standard-kernels and not much else changed. all are patched up to date. the specification for the HDD is available at: http://www.hitachigst.com/tech/techlib.nsf/techdocs/8697AD25DFD002AB86256FCC... this is probably not enough information to locate/fix the bug but i was not really sure what else to include. tell me what you need and i'll add it to this bug immediately. thanks.. tty, axel -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=237446 lmb@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|kernel- |oneukum@novell.com |maintainers@forge.provo.nove| |ll.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=237446 oneukum@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=237446 oneukum@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEEDINFO Info Provider| |ag@pre-secure.de ------- Comment #1 from oneukum@novell.com 2007-01-23 05:22 MST ------- Hi, I need "lsusb -v" as root for your disk. Regards Oliver -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=237446 ag@pre-secure.de changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |ASSIGNED Info Provider|ag@pre-secure.de | ------- Comment #2 from ag@pre-secure.de 2007-01-23 05:30 MST ------- Created an attachment (id=114384) --> (https://bugzilla.novell.com/attachment.cgi?id=114384&action=view) lsusb -v for the disk i included the complete output of "lsusb -v" in the attachment. the disk is: Bus 004 Device 007: ID ed06:4500 iManufacturer 16 DATAST0R Technology Corp iProduct 32 USB4500 FW1.04 There is one other usb-device currently in a slot, a "DataTraveler" usb-stick. i hope this is no problem. i can have it removed if you like. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=237446 ------- Comment #3 from ag@pre-secure.de 2007-01-23 05:44 MST ------- oh, btw. i forgot to mention in the original report, that i also tried the disk on one other 10.1 system that was a siemens fujitsu notebook. on that system, opensuse 10.1 also showed the wrong size. so it does not seem to be related to the EPIA's hardware. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=237446 oneukum@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEEDINFO Info Provider| |ag@pre-secure.de ------- Comment #4 from oneukum@novell.com 2007-01-23 06:14 MST ------- Hi, your converter has been reported as buggy. It is said to report the total numbers of sectors, not the highest sector number, leading to a capacity one sector too high. It seems that your disk is not buggy and applying the fix will decrease its capacity. Thus 2.6.13 without the fix works and the later kernels do not. I'll get into contact with the original reporter. Can you deal with a kernel patch if I send you it? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=237446 ag@pre-secure.de changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |ASSIGNED Info Provider|ag@pre-secure.de | ------- Comment #5 from ag@pre-secure.de 2007-01-23 06:27 MST ------- yes, i could deal with a patch. do you mean my disk is not buggy or that my version of that converter is not buggy? you mean the converter, right? just to recap what i understood, so there is no misunderstanding: someone else reported that converter as buggy, a fix that automatically reduces the capacity by one sector was integrated starting 10.1 and not it seems that my version of that converter does not have this bug and the capacity is incorrectly reduced? the converter i use reports firmware version "1.04", maybe that error was fixed by now. i had the same incorrectly decreased with a converter based on a prolific PL-3507 chip. was that converter also reported as buggy? i could send you lsusb -v for that converter as well, but that would take a day or two, since i am currently not at the office where that machine is located. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=237446 ------- Comment #6 from ag@pre-secure.de 2007-01-23 06:47 MST ------- i just had a quick look in drivers/usb/storage/unusual_devs.h both converters i have are tagged as unusual device with US_FL_FIX_CAPACITY. (the prolific has id 067b:3507) have both converters had the same problem and are fixed now? or did i misunderstand something here? i'll try to re-test the prolific converter tomorrow... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=237446
------- Comment #7 from oneukum@novell.com 2007-01-23 06:56 MST -------
Yes,
this is the entry for your device (unusual_devs.h):
/* Reported by Andrew Simmons
https://bugzilla.novell.com/show_bug.cgi?id=237446 ------- Comment #8 from oneukum@novell.com 2007-01-23 07:02 MST ------- Created an attachment (id=114415) --> (https://bugzilla.novell.com/attachment.cgi?id=114415&action=view) patch to remove incorrect unusual_devs entry Please apply this patch to your kernel -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=237446 oneukum@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEEDINFO Info Provider| |ag@pre-secure.de ------- Comment #9 from oneukum@novell.com 2007-01-23 07:03 MST ------- Regarding the prolofic converter, please also provide "lsusb -v"
have both converters had the same problem and are fixed now? or did i misunderstand something here?
You are understanding this correctly and you are very unlucky, I am afraid. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=237446 ------- Comment #10 from ag@pre-secure.de 2007-01-23 07:28 MST ------- Created an attachment (id=114425) --> (https://bugzilla.novell.com/attachment.cgi?id=114425&action=view) lsusb -v for the prolific PL3507 converter ok, here is lsusb for the prolific... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=237446 ag@pre-secure.de changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |ASSIGNED Info Provider|ag@pre-secure.de | ------- Comment #11 from ag@pre-secure.de 2007-01-23 07:38 MST ------- it seems like there are different revisions of the PL3507. at least revisions A,B and C. i have revision C. unfortunately bcdDevice (which i understand denotes the revision of a device) seems to be the same for all revisions. a few firmawares are available here: http://www.prolific.com.tw/eng/downloads.asp?ID=44 i am currently looking through the firmware's release notes, but nothing interesting yet. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=237446 ------- Comment #12 from ag@pre-secure.de 2007-01-23 08:32 MST ------- Created an attachment (id=114450) --> (https://bugzilla.novell.com/attachment.cgi?id=114450&action=view) firmware revision history for PL-3507 in case this helps, here is the most up-to-date list of firmware releases for the prolific PL-3507 converter. it even includes a few linux-specific fixes. i could not find a specific change-item that looks like the off-by-one-sector bug was fixed. it seems that only revisions B and C are updatable. unfortunately, the revision history just includes dates, not versions and i havent found a way yet, to read the firmware version out of my prolific converter. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=237446 oneukum@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEEDINFO Info Provider| |ag@pre-secure.de ------- Comment #13 from oneukum@novell.com 2007-01-23 13:23 MST ------- Does the kernel patch fix the issue for you? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=237446 ag@pre-secure.de changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |ASSIGNED Info Provider|ag@pre-secure.de | ------- Comment #14 from ag@pre-secure.de 2007-01-24 10:31 MST ------- yes, it does. i just build a new usb-storage module with my converters removed from unusual_devs.h, and now fdisk shows the correct size for the hard disks. thanks a lot! -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=237446 oneukum@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEEDINFO Info Provider| |ag@pre-secure.de ------- Comment #15 from oneukum@novell.com 2007-02-02 02:32 MST ------- Would you test another kernel patch that should allow the old and the new version to work? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=237446 ag@pre-secure.de changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |ASSIGNED Info Provider|ag@pre-secure.de | ------- Comment #16 from ag@pre-secure.de 2007-02-02 04:05 MST ------- yes, sure. no problem. by the way, how about having an algorithm in the driver that decides about the semantics of the reported number depending on wheter it is even or odd? i don't think there is any usb-storage device out there that has an odd number of sectors. so for devices where broken and good implementations are out there (or even for all devices) the driver could just check the reported number of sectors. if it is odd, it is the number of the highest sector and can be used directly. if it is even, it is even, the usb/ide-converter reports the number of sectors and the driver can subtract one sector. well, since you already seem to have a general fix, my idea is probably a little late. anyway, it was just a thought i had the other day. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=237446 ------- Comment #17 from oneukum@novell.com 2007-02-02 05:20 MST ------- The fix works on quite similar principles. It occured to me that devices usually follow a pseudo-geometry. Therefore the number of sectors should be divisible by 63*255 without a remainder. I'll attach the patch. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=237446 ------- Comment #18 from oneukum@novell.com 2007-02-02 05:24 MST ------- Created an attachment (id=117059) --> (https://bugzilla.novell.com/attachment.cgi?id=117059&action=view) patch to heuristically determine whether a device reports a quirky size -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=237446
------- Comment #19 from ag@pre-secure.de 2007-02-03 14:27 MST -------
your patch results in an unresolved symbol in the scsi-hdd module:
WARNING: /lib/modules/2.6.18.2-34-default/kernel/drivers/scsi/sd_mod.ko needs
unknown symbol __umoddi3
i found, that these lines you add to sd.c cause it:
if (sdkp->capacity % (63 * 255))
--sdkp->capacity;
it seems that sdkp->capacity is a 64bit number and so % requires 64bit
arithmetics. i am using a 32bit platform. could it be, that you're developing
on a 64bit platform, and so did not notice this when compiling?
i found, as a suggested fix that
https://bugzilla.novell.com/show_bug.cgi?id=237446 oneukum@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED ------- Comment #20 from oneukum@novell.com 2007-02-08 01:25 MST ------- I have taken your suggestion and submitted it to the kernel. I consider this bug fixed. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=237446 ------- Comment #21 from ag@pre-secure.de 2007-02-09 15:10 MST ------- me too. thanks a lot for the great support and quick fix! :) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
participants (1)
-
bugzilla_noreply@novell.com