android_kernel_samsung_msm8976/drivers/scsi
Wei Fang 52f5551873 scsi: fix race between simultaneous decrements of ->host_failed
commit 72d8c36ec364c82bf1bf0c64dfa1041cfaf139f7 upstream.

sas_ata_strategy_handler() adds the works of the ata error handler to
system_unbound_wq. This workqueue asynchronously runs work items, so the
ata error handler will be performed concurrently on different CPUs. In
this case, ->host_failed will be decreased simultaneously in
scsi_eh_finish_cmd() on different CPUs, and become abnormal.

It will lead to permanently inequality between ->host_failed and
->host_busy, and scsi error handler thread won't start running. IO
errors after that won't be handled.

Since all scmds must have been handled in the strategy handler, just
remove the decrement in scsi_eh_finish_cmd() and zero ->host_busy after
the strategy handler to fix this race.

Fixes: 50824d6c56 ("[SCSI] libsas: async ata-eh")
Cc: stable@vger.kernel.org
Signed-off-by: Wei Fang <fangwei1@huawei.com>
Reviewed-by: James Bottomley <jejb@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
2019-07-27 21:41:57 +02:00
..
aacraid aacraid: Fix memory leak in aac_fib_map_free 2016-06-07 10:42:45 +02:00
aic7xxx
aic7xxx_old
aic94xx
arcmsr SCSI: arcmsr: upper 32 of dma address lost 2014-05-06 07:55:30 -07:00
arm
be2iscsi be2iscsi: set the boot_kset pointer to NULL in case of failure 2016-06-07 10:42:45 +02:00
bfa bfa: Fix undefined bit shift on big-endian architectures with 32-bit DMA address 2014-09-17 09:03:59 -07:00
bnx2fc bnx2fc: do not add shared skbs to the fcoe_rx_list 2014-12-06 15:05:49 -08:00
bnx2i
csiostor
cxgbi
device_handler BACKPORT: block: add blk_rq_set_block_pc() 2017-04-22 23:03:01 +02:00
dpt
fcoe
fnic
ibmvscsi ibmvscsi: Add memory barriers for send / receive 2014-07-09 11:13:59 -07:00
isci arch: Mass conversion of smp_mb__*() 2014-08-15 11:45:28 -07:00
libfc libfc: Fix fc_fcp_cleanup_each_cmd() 2015-09-13 09:07:59 -07:00
libsas libsas: Fix Kernel Crash in smp_execute_task 2015-03-26 15:01:00 +01:00
lpfc lpfc: fix misleading indentation 2016-06-07 10:42:52 +02:00
megaraid megaraid_sas : SMAP restriction--do not access user memory from IOCTL code 2016-03-03 15:06:20 -08:00
mpt2sas mpt2sas: Don't disable device twice at suspend. 2014-05-13 13:59:41 +02:00
mpt3sas
mvsas mvsas: Fix NULL pointer dereference in mvs_slot_task_free 2015-11-09 10:12:59 -08:00
osd BACKPORT: block: add blk_rq_set_block_pc() 2017-04-22 23:03:01 +02:00
pcmcia
pm8001
qla2xxx qla2xxx: Mark port lost when we receive an RSCN for it. 2015-08-03 09:29:47 -07:00
qla4xxx
sym53c8xx_2 sym53c8xx_2: Set DID_REQUEUE return code when aborting squeue 2014-07-09 11:14:03 -07:00
ufs scsi: ufs: Fix off-by-one bug in ufs debugfs driver 2018-01-23 21:21:55 -08:00
.gitignore
3w-9xxx.c 3w-9xxx: don't unmap bounce buffered commands 2015-10-22 14:37:53 -07:00
3w-9xxx.h 3w-9xxx: fix command completion race 2015-05-13 05:15:42 -07:00
3w-sas.c 3w-sas: fix command completion race 2015-05-13 05:15:42 -07:00
3w-sas.h 3w-sas: fix command completion race 2015-05-13 05:15:42 -07:00
3w-xxxx.c 3w-xxxx: fix command completion race 2015-05-13 05:15:42 -07:00
3w-xxxx.h 3w-xxxx: fix command completion race 2015-05-13 05:15:42 -07:00
53c700.c
53c700.h
53c700.scr
53c700_d.h_shipped
BusLogic.c
BusLogic.h
FlashPoint.c
Kconfig
Makefile
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
aha152x.c
aha152x.h
aha1542.c
aha1542.h
aha1740.c
aha1740.h
aic7xxx_old.c
atari_NCR5380.c
atari_scsi.c
atari_scsi.h
atp870u.c
atp870u.h
bvme6000_scsi.c
ch.c
constants.c
dc395x.c
dc395x.h
dmx3191d.c
dpt_i2o.c
dpti.h
dtc.c
dtc.h
eata.c
eata_generic.h
eata_pio.c
eata_pio.h
esp_scsi.c
esp_scsi.h
fdomain.c
fdomain.h
g_NCR5380.c
g_NCR5380.h
g_NCR5380_mmio.c
gdth.c
gdth.h
gdth_ioctl.h
gdth_proc.c
gdth_proc.h
gvp11.c
gvp11.h
hosts.c Fix a memory leak in scsi_host_dev_release() 2016-02-25 11:57:47 -08:00
hpsa.c hpsa: add missing pci_set_master in kdump path 2015-07-03 19:48:09 -07:00
hpsa.h
hpsa_cmd.h
hptiop.c
hptiop.h
imm.c
imm.h
in2000.c
in2000.h
initio.c
initio.h
ipr.c ipr: Fix regression when loading firmware 2016-06-07 10:42:47 +02:00
ipr.h ipr: Fix incorrect trace indexing 2015-08-16 20:51:36 -07:00
ips.c
ips.h
iscsi_boot_sysfs.c
iscsi_tcp.c
iscsi_tcp.h
jazz_esp.c
lasi700.c
libiscsi.c SCSI: libiscsi: fix potential buffer overrun in __iscsi_conn_send_pdu 2014-10-05 14:54:12 -07:00
libiscsi_tcp.c
libsrp.c
mac53c94.c
mac53c94.h
mac_esp.c
mac_scsi.c
mac_scsi.h
megaraid.c
megaraid.h
mesh.c
mesh.h
mvme16x_scsi.c
mvme147.c
mvme147.h
mvumi.c
mvumi.h
ncr53c8xx.c
ncr53c8xx.h
nsp32.c
nsp32.h
nsp32_debug.c
nsp32_io.h
osst.c BACKPORT: block: add blk_rq_set_block_pc() 2017-04-22 23:03:01 +02:00
osst.h
osst_detect.h
osst_options.h
pas16.c
pas16.h
pmcraid.c
pmcraid.h
ppa.c
ppa.h
ps3rom.c
qla1280.c
qla1280.h
qlogicfas.c
qlogicfas408.c
qlogicfas408.h
qlogicpti.c
qlogicpti.h
raid_class.c
script_asm.pl
scsi.c
scsi.h
scsi_debug.c
scsi_devinfo.c
scsi_error.c scsi: fix race between simultaneous decrements of ->host_failed 2019-07-27 21:41:57 +02:00
scsi_ioctl.c
scsi_lib.c BACKPORT: block: add blk_rq_set_block_pc() 2017-04-22 23:03:01 +02:00
scsi_lib_dma.c
scsi_logging.h
scsi_module.c
scsi_netlink.c net: Use netlink_ns_capable to verify the permisions of netlink messages 2014-06-26 15:12:37 -04:00
scsi_pm.c scsi: pm: keep request queue and scsi device runtime status in sync 2014-11-18 18:50:37 -08:00
scsi_priv.h
scsi_proc.c
scsi_sas_internal.h
scsi_scan.c Merge upstream tag 'v3.10.49' into msm-3.10 2014-08-20 13:23:09 -07:00
scsi_sysctl.c
scsi_sysfs.c This is the 3.10.98 stable release 2017-04-18 17:17:24 +02:00
scsi_tgt_if.c
scsi_tgt_lib.c
scsi_tgt_priv.h
scsi_trace.c
scsi_transport_api.h
scsi_transport_fc.c
scsi_transport_fc_internal.h
scsi_transport_iscsi.c
scsi_transport_sas.c
scsi_transport_spi.c
scsi_transport_srp.c
scsi_transport_srp_internal.h
scsi_typedefs.h
scsicam.c
sd.c This is the 3.10.98 stable release 2017-04-18 17:17:24 +02:00
sd.h Import latest Samsung release 2017-04-18 03:43:52 +02:00
sd_dif.c
ses.c ses: fix additional element traversal bug 2016-03-03 15:06:22 -08:00
sg.c Merge "scsi: sg: check length passed to SG_NEXT_CMD_LEN" 2018-01-26 09:41:04 -08:00
sgiwd93.c
sim710.c
sni_53c710.c
sr.c SCSI: fix crashes in sd and sr runtime PM 2016-02-25 11:57:47 -08:00
sr.h
sr_ioctl.c
sr_vendor.c
st.c BACKPORT: block: add blk_rq_set_block_pc() 2017-04-22 23:03:01 +02:00
st.h
st_options.h
stex.c
storvsc_drv.c scsi: storvsc: Fix a bug in copy_from_bounce_buffer() 2015-05-06 21:56:26 +02:00
sun3_NCR5380.c
sun3_scsi.c
sun3_scsi.h
sun3_scsi_vme.c
sun3x_esp.c
sun_esp.c
sym53c416.c
sym53c416.h
t128.c
t128.h
tmscsim.c
tmscsim.h
u14-34f.c
ultrastor.c
ultrastor.h
virtio_scsi.c virtio-scsi: fix various bad behavior on aborted requests 2014-07-09 11:13:59 -07:00
vmw_pvscsi.c
vmw_pvscsi.h
wd33c93.c
wd33c93.h
wd7000.c
zalon.c
zorro7xx.c