linux/include/scsi
Alan Jenkins 2b14290078 [SCSI] extend the last_sector_bug flag to cover more sectors
The last_sector_bug flag was added to work around a bug in certain usb
cardreaders, where they would crash if a multiple sector read included the
last sector. The original implementation avoids this by e.g. splitting an 8
sector read which includes the last sector into a 7 sector read, and a single
sector read for the last sector.  The flag is enabled for all USB devices.

This revealed a second bug in other usb cardreaders, which crash when they
get a multiple sector read which stops 1 sector short of the last sector.
Affected hardware includes the Kingston "MobileLite" external USB cardreader
and the internal USB cardreader on the Asus EeePC.

Extend the last_sector_bug workaround to ensure that any access which touches
the last 8 hardware sectors of the device is a single sector long.  Requests
are shrunk as necessary to meet this constraint.

This gives us a safety margin against potential unknown or future bugs
affecting multi-sector access to the end of the device.  The two known bugs
only affect the last 2 sectors.  However, they suggest that these devices
are prone to fencepost errors and that multi-sector access to the end of the
device is not well tested.  Popular OS's use multi-sector accesses, but they
rarely read the last few sectors.  Linux (with udev & vol_id) automatically
reads sectors from the end of the device on insertion.  It is assumed that
single sector accesses are more thoroughly tested during development.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Tested-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-27 10:16:13 -04:00
..
iscsi_if.h [SCSI] iscsi class: Add session initiatorname and ifacename sysfs attrs. 2008-07-12 08:22:21 -05:00
iscsi_proto.h [SCSI] iscsi_tcp: Enable any size command 2008-07-12 08:22:23 -05:00
libiscsi.h [SCSI] libiscsi, iser, tcp: remove recv_lock 2008-07-12 08:22:22 -05:00
libsas.h
libsrp.h
sas_ata.h
sas.h
scsi_cmnd.h [SCSI] Support devices with protection information 2008-07-26 15:14:55 -04:00
scsi_dbg.h
scsi_device.h [SCSI] extend the last_sector_bug flag to cover more sectors 2008-07-27 10:16:13 -04:00
scsi_devinfo.h
scsi_dh.h [SCSI] scsi_dh: attach to hardware handler from dm-mpath 2008-07-26 15:14:53 -04:00
scsi_driver.h
scsi_eh.h [SCSI] scsi_eh_prep_cmnd should save scmd->underflow 2008-07-26 15:14:56 -04:00
scsi_host.h [SCSI] Host protection capabilities 2008-07-26 15:14:54 -04:00
scsi_ioctl.h
scsi_netlink_fc.h
scsi_netlink.h
scsi_tcq.h
scsi_tgt_if.h
scsi_tgt.h
scsi_transport_fc.h driver core: remove KOBJ_NAME_LEN define 2008-07-21 21:54:52 -07:00
scsi_transport_iscsi.h driver core: remove KOBJ_NAME_LEN define 2008-07-21 21:54:52 -07:00
scsi_transport_sas.h
scsi_transport_spi.h
scsi_transport_srp.h
scsi_transport.h
scsi.h [SCSI] scsi_dh: add generic SPC-3 alua handler 2008-07-26 15:14:52 -04:00
scsicam.h
sg.h [SCSI] sg: Add target reset support 2008-07-12 08:22:32 -05:00
srp.h