Re: sd_mod or usb-storage fails to read a single good block (was: ehci_hcd fails to read a single good block)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 6 Apr 2012, Norman Diamond wrote:

> > However there's no question that other bridges having the same vendor, product, and revision ID values as yours _did_ report the drive capacity incorrectly; otherwise the quirk entry would not be there.� What I'm not sure of is whether those bridges went on to crash as dramatically as yours.
> 
> Except that mine doesn't crash when trying to read a nonexistent block, so the quirk handling still looks overly aggressive.

You're not thinking about it the right way.  If the quirk handling were 
any less agressive, it would fail to work entirely on some devices 
(those that crash when trying to access a nonexistent block).  Such 
devices would not usable at all.

Besides, suppose this quirk entry were removed.  What would happen with
the other bridges with the same ID numbers that do not decrement the
block count properly?  Linux would try to access the nonexistent last
block, and the access would fail.  Perhaps no unplug and replug would
be needed, but any data destined for that block would be lost.

> >> This still makes me wonder why Windows is able to handle the same bridges.
> > 
> > Probably because Windows does not try to read the last block, unless it is occupied by a file.
> 
> I think Windows does.  At least in some cases the last block of a partition contains structural information and can't be used for files.  At least in some cases Windows reports a file system error if that block can't be accessed when trying to mount the partition.

Not in any of the cases I have seen or heard of, but that isn't a very 
large sampling.

>  Now, Windows won't have this trouble with my bridge because Windows saw the correct drive size through my bridge.  Only Linux will have trouble.  I'll have to see if I can create a suitable partition in Windows and then get a Linux error when trying to mount the partition without its last sector.

You'll get an error right away; the partition-table-reading code
doesn't accept partitions that appear to extend past the end of the 
device.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux