WSL2-Linux-Kernel/drivers/scsi
Alan Stern 6a0bdffa00 SCSI & usb-storage: add try_rc_10_first flag
Several bug reports have been received recently for USB mass-storage
devices that don't handle READ CAPACITY(16) commands properly.  They
report bogus sizes, in some cases becoming unusable as a result.

The bugs were triggered by commit
09b6b51b0b (SCSI & usb-storage: add
flags for VPD pages and REPORT LUNS), which caused usb-storage to stop
overriding the SCSI level reported by devices.  By default, the sd
driver will try READ CAPACITY(16) first for any device whose level is
above SCSI_SPC_2.

It seems likely that any device large enough to require the use of
READ CAPACITY(16) (i.e., 2 TB or more) would be able to handle READ
CAPACITY(10) commands properly.  Indeed, I don't know of any devices
that don't handle READ CAPACITY(10) properly.

Therefore this patch (as1559) adds a new flag telling the sd driver
to try READ CAPACITY(10) before READ CAPACITY(16), and sets this flag
for every USB mass-storage device.  If a device really is larger than
2 TB, sd will fall back to READ CAPACITY(16) just as it used to.

This fixes Bugzilla #43391.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Hans de Goede <hdegoede@redhat.com>
CC: "James E.J. Bottomley" <JBottomley@parallels.com>
CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-22 22:05:31 -07:00
..
aacraid [SCSI] aacraid: add an iounmap call to aac_src_ioremap 2012-04-23 19:28:24 +01:00
aic7xxx Documentation: remove references to /etc/modprobe.conf 2012-03-30 16:03:15 -07:00
aic7xxx_old
aic94xx aic94xx: Get rid of redundant NULL check before release_firmware() call 2012-04-30 13:22:58 +02:00
arcmsr Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
arm Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
be2iscsi [SCSI] be2iscsi: fix dma free size mismatch regression 2012-05-30 13:34:22 +04:00
bfa [SCSI] bfa: Fix to set vport FC host sysfs entries 2012-05-22 11:06:29 +01:00
bnx2fc [SCSI] fcoe, bnx2fc, libfcoe: SW FCoE and bnx2fc use FCoE Syfs 2012-05-23 09:43:13 +01:00
bnx2i [SCSI] bnx2i: Updated version and copyright year 2012-05-10 09:04:18 +01:00
cxgbi
device_handler [SCSI] scsi_dh_alua: Optimize the STPG command 2012-04-23 19:28:18 +01:00
dpt
fcoe [SCSI] fcoe, bnx2fc, libfcoe: SW FCoE and bnx2fc use FCoE Syfs 2012-05-23 09:43:13 +01:00
fnic
ibmvscsi powerpc+sparc/vio: Modernize driver registration 2012-03-28 11:33:24 +11:00
isci isci: End the RNC resumption wait when the RNC is destroyed. 2012-05-17 14:33:44 -07:00
libfc isci update for 3.5 2012-05-21 12:17:30 +01:00
libsas [SCSI] Revert "[SCSI] libsas: fix sas port naming" 2012-04-23 12:15:53 +01:00
lpfc [SCSI] lpfc 8.3.31: Update lpfc to version 8.3.31 2012-05-17 11:18:30 +01:00
megaraid [SCSI] megaraid_sas: Version and Changelog update 2012-04-23 19:26:41 +01:00
mpt2sas [SCSI] mpt2sas: Fix unsafe using smp_processor_id() in preemptible 2012-06-06 12:38:56 +09:00
mvsas
osd
pcmcia
pm8001 [SCSI] pm8001: raise host can queue 2012-05-10 09:02:07 +01:00
qla2xxx qla2xxx: Remove version.h header file inclusion 2012-06-12 21:25:50 -07:00
qla4xxx [SCSI] qla4xxx: Update driver version to 5.02.00-k17 2012-05-30 13:01:34 +04:00
sym53c8xx_2
ufs [SCSI] ufs: fix potential NULL pointer dereferencing error in ufshcd_prove. 2012-05-23 09:29:39 +01:00
.gitignore
3w-9xxx.c
3w-9xxx.h
3w-sas.c
3w-sas.h
3w-xxxx.c
3w-xxxx.h
53c700.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
53c700.h
53c700.scr
53c700_d.h_shipped
BusLogic.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
BusLogic.h
FlashPoint.c
Kconfig Merge branch 'delete-mca' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux 2012-05-23 17:12:06 -07:00
Makefile scsi: delete the MCA specific drivers and driver code 2012-05-17 19:03:54 -04:00
NCR53c406a.c
NCR5380.c
NCR5380.h
NCR_D700.c
NCR_D700.h
NCR_Q720.c
NCR_Q720.h
a100u2w.c
a100u2w.h
a2091.c
a2091.h
a3000.c
a3000.h
a4000t.c
advansys.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
aha152x.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
aha152x.h
aha1542.c scsi: delete the MCA specific drivers and driver code 2012-05-17 19:03:54 -04:00
aha1542.h
aha1740.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
aha1740.h
aic7xxx_old.c
atari_NCR5380.c
atari_scsi.c scsi/atari: Make more functions static 2012-04-22 20:16:49 +02:00
atari_scsi.h scsi/atari: Make more functions static 2012-04-22 20:16:49 +02:00
atp870u.c SCSI updates on 20120331 2012-03-31 13:31:23 -07:00
atp870u.h
bvme6000_scsi.c
ch.c
constants.c
dc395x.c
dc395x.h
dmx3191d.c
dpt_i2o.c
dpti.h
dtc.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
dtc.h
eata.c
eata_generic.h
eata_pio.c
eata_pio.h
esp_scsi.c scsi: Use vsprintf extention %pf with builtin_return_address 2012-04-05 17:09:40 -07:00
esp_scsi.h
fdomain.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
fdomain.h
g_NCR5380.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
g_NCR5380.h
g_NCR5380_mmio.c
gdth.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
gdth.h
gdth_ioctl.h
gdth_proc.c
gdth_proc.h
gvp11.c
gvp11.h
hosts.c [SCSI] fix oops in all legacy host adapters caused by 6f381fa 2012-05-10 08:24:13 +01:00
hpsa.c [SCSI] hpsa: dial down lockup detection during firmware flash 2012-05-10 09:19:39 +01:00
hpsa.h [SCSI] hpsa: dial down lockup detection during firmware flash 2012-05-10 09:19:39 +01:00
hpsa_cmd.h [SCSI] hpsa: dial down lockup detection during firmware flash 2012-05-10 09:19:39 +01:00
hptiop.c
hptiop.h
imm.c
imm.h
in2000.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
in2000.h
initio.c
initio.h
ipr.c [SCSI] libsas, libata: fix start of life for a sas ata_port 2012-04-23 12:11:47 +01:00
ipr.h [SCSI] ipr: Driver version 2.5.3 2012-03-28 15:09:28 +01:00
ips.c
ips.h
iscsi_boot_sysfs.c
iscsi_tcp.c sock: Introduce named constants for sk_reuse 2012-04-21 15:52:25 -04:00
iscsi_tcp.h
jazz_esp.c
lasi700.c
libiscsi.c
libiscsi_tcp.c
libsrp.c
mac53c94.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
mac53c94.h
mac_esp.c
mac_scsi.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
mac_scsi.h
megaraid.c
megaraid.h
mesh.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
mesh.h
mvme16x_scsi.c
mvme147.c
mvme147.h
mvumi.c
mvumi.h
ncr53c8xx.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
ncr53c8xx.h
nsp32.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
nsp32.h
nsp32_debug.c
nsp32_io.h
osst.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
osst.h
osst_detect.h
osst_options.h
pas16.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
pas16.h
pmcraid.c
pmcraid.h
ppa.c
ppa.h
ps3rom.c
qla1280.c qla1280: Remove redundant NULL check before release_firmware() call 2012-04-30 13:25:43 +02:00
qla1280.h
qlogicfas.c
qlogicfas408.c
qlogicfas408.h
qlogicpti.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
qlogicpti.h
raid_class.c
script_asm.pl
scsi.c [SCSI] Fix sd_probe_domain config problem 2012-06-07 10:16:20 +09:00
scsi.h
scsi_debug.c SCSI updates on 20120331 2012-03-31 13:31:23 -07:00
scsi_devinfo.c
scsi_error.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2012-05-22 19:22:50 -07:00
scsi_ioctl.c
scsi_lib.c [SCSI] Fix dm-multipath starvation when scsi host is busy 2012-05-23 09:34:17 +01:00
scsi_lib_dma.c
scsi_logging.h
scsi_module.c
scsi_netlink.c
scsi_pm.c [SCSI] scsi_pm: resume device if suspend failed 2012-05-22 11:09:50 +01:00
scsi_priv.h [SCSI] sd: limit the scope of the async probe domain 2012-05-17 09:10:46 +01:00
scsi_proc.c
scsi_sas_internal.h
scsi_scan.c [SCSI] fix async probe regression 2012-05-30 13:37:07 +04:00
scsi_sysctl.c
scsi_sysfs.c
scsi_tgt_if.c
scsi_tgt_lib.c
scsi_tgt_priv.h
scsi_trace.c
scsi_transport_api.h
scsi_transport_fc.c [SCSI] fc class: fix scanning when devs are offline 2012-05-10 08:59:23 +01:00
scsi_transport_fc_internal.h
scsi_transport_iscsi.c [SCSI] iscsi class: fix gfp use in ping compl and host event 2012-03-27 08:26:36 +01:00
scsi_transport_sas.c
scsi_transport_spi.c [SCSI] scsi_transport_spi: fix for unbalanced reference counting 2012-05-10 09:06:12 +01:00
scsi_transport_srp.c
scsi_transport_srp_internal.h
scsi_typedefs.h
scsi_wait_scan.c [SCSI] fix scsi_wait_scan 2012-05-30 13:46:37 +04:00
scsicam.c
sd.c SCSI & usb-storage: add try_rc_10_first flag 2012-06-22 22:05:31 -07:00
sd.h
sd_dif.c
ses.c
sg.c [SCSI] sg: constify sg_proc_leaf_arr 2012-05-17 10:08:57 +01:00
sgiwd93.c
sim710.c scsi: delete the MCA specific drivers and driver code 2012-05-17 19:03:54 -04:00
sni_53c710.c
sr.c
sr.h
sr_ioctl.c
sr_vendor.c
st.c SCSI updates on 20120331 2012-03-31 13:31:23 -07:00
st.h [SCSI] st: fix memory leak with >1MB tape I/O 2012-05-10 08:32:34 +01:00
st_options.h
stex.c
storvsc_drv.c [SCSI] storvsc: Properly handle errors from the host 2012-04-25 09:51:43 +01:00
sun3_NCR5380.c
sun3_scsi.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
sun3_scsi.h
sun3_scsi_vme.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
sun3x_esp.c
sun_esp.c
sym53c416.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
sym53c416.h
t128.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
t128.h
tmscsim.c
tmscsim.h
u14-34f.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
ultrastor.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
ultrastor.h
virtio_scsi.c [SCSI] virtio_scsi: fix TMF use-after-free 2012-05-10 08:27:06 +01:00
vmw_pvscsi.c [SCSI] vmw_pvscsi: Try setting host->max_id as suggested by the device. 2012-03-27 08:26:36 +01:00
vmw_pvscsi.h [SCSI] vmw_pvscsi: Try setting host->max_id as suggested by the device. 2012-03-27 08:26:36 +01:00
wd33c93.c
wd33c93.h
wd7000.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
zalon.c
zorro7xx.c