* Regression fix: Generalise last_sector_bug to avoid breaking more buggy devices
@ 2008-07-24 10:15 Alan Jenkins
0 siblings, 0 replies; only message in thread
From: Alan Jenkins @ 2008-07-24 10:15 UTC (permalink / raw)
To: James.Bottomley; +Cc: linux-scsi, Alan Stern
You may remember the unfortunately named "last_sector_bug" workaround.
It was applied to the SCSI SD driver to handle certain USB cardreaders.
Unfortunately it introduced a regression by breaking certain other buggy
USB cardreaders.
I ended up driving this fix, as the sucker who bought the second lot of
buggy hardware. Alan Stern from USB-land said that he's happy to see
this patch merged (after fixing my logic and critiquing the patch
description). I'm grateful for his help and everyone else who chimed in
on the usb-storage mailing list.
The patch description goes into detail. Here's a less formal description -
The original bug causes multi-sector accesses which include the last
sector of the device to fail. The workaround was to split such accesses
in two, so that the last sector is accessed on it's own. The overhead
is minimal and so it was applied to all USB storage devices.
Perversely, this revealed a second bug in a different set of card
readers. This time, failure is caused by multi-sector accesses which
stop just short of the last sector.
This suggests a systemic failure in the design/testing of USB
cardreaders, where multi-sector accesses to the last sectors are
overlooked, and fencepost errors may be common. What follows is a
general workaround to prevent multi-sector accesses touching any of the
last 8 hardware sectors.
Thanks
Alan
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-07-24 10:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-24 10:15 Regression fix: Generalise last_sector_bug to avoid breaking more buggy devices Alan Jenkins
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox