Regression fix: Generalise last_sector_bug to avoid breaking more buggy devices

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

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux