kernel-fxtec-pro1x/drivers
Anton Eidelman 6376736d01 nvme-multipath: fix possible io hang after ctrl reconnect
[ Upstream commit af8fd0424713a2adb812d10d55e86718152cf656 ]

The following scenario results in an IO hang:
1) ctrl completes a request with NVME_SC_ANA_TRANSITION.
   NVME_NS_ANA_PENDING bit in ns->flags is set and ana_work is triggered.
2) ana_work: nvme_read_ana_log() tries to get the ANA log page from the ctrl.
   This fails because ctrl disconnects.
   Therefore nvme_update_ns_ana_state() is not called
   and NVME_NS_ANA_PENDING bit in ns->flags is not cleared.
3) ctrl reconnects: nvme_mpath_init(ctrl,...) calls
   nvme_read_ana_log(ctrl, groups_only=true).
   However, nvme_update_ana_state() does not update namespaces
   because nr_nsids = 0 (due to groups_only mode).
4) scan_work calls nvme_validate_ns() finds the ns and re-validates OK.

Result:
The ctrl is now live but NVME_NS_ANA_PENDING bit in ns->flags is still set.
Consequently ctrl will never be considered a viable path by __nvme_find_path().
IO will hang if ctrl is the only or the last path to the namespace.

More generally, while ctrl is reconnecting, its ANA state may change.
And because nvme_mpath_init() requests ANA log in groups_only mode,
these changes are not propagated to the existing ctrl namespaces.
This may result in a mal-function or an IO hang.

Solution:
nvme_mpath_init() will nvme_read_ana_log() with groups_only set to false.
This will not harm the new ctrl case (no namespaces present),
and will make sure the ANA state of namespaces gets updated after reconnect.

Note: Another option would be for nvme_mpath_init() to invoke
nvme_parse_ana_log(..., nvme_set_ns_ana_state) for each existing namespace.

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Anton Eidelman <anton@lightbitslabs.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-11-12 19:21:11 +01:00
..
accessibility
acpi ACPI: CPPC: Set pcc_data[pcc_ss_id] to NULL in acpi_cppc_processor_exit() 2019-10-29 09:19:52 +01:00
amba
android binder: fix possible UAF when freeing buffer 2019-08-04 09:30:53 +02:00
ata libata/ahci: Fix PCS quirk application 2019-10-29 09:19:36 +01:00
atm Kconfig: Fix the reference to the IDT77105 Phy driver in the description of ATM_NICSTAR_USE_IDT77105 2019-09-21 07:16:57 +02:00
auxdisplay auxdisplay: panel: need to delete scan_timer when misc_register fails in panel_attach 2019-09-06 10:21:56 +02:00
base cpufreq: Avoid cpufreq_suspend() deadlock on system shutdown 2019-10-29 09:20:08 +01:00
bcma
block nbd: handle racing with error'ed out commands 2019-11-10 11:27:35 +01:00
bluetooth Bluetooth: btrtl: Additional Realtek 8822CE Bluetooth devices 2019-10-01 08:26:12 +02:00
bus bus: ti-sysc: Simplify cleanup upon failures in sysc_probe() 2019-09-21 07:16:51 +02:00
cdrom cdrom: Fix race condition in cdrom_sysctl_register 2019-04-05 22:33:10 +02:00
char ipmi_si: Only schedule continuously in the thread in maintenance mode 2019-10-07 18:56:39 +02:00
clk clk: boston: unregister clks on failure in clk_boston_setup() 2019-11-06 13:05:26 +01:00
clocksource clocksource/drivers/exynos_mct: Increase priority over ARM arch timer 2019-07-26 09:14:12 +02:00
connector connector: fix unsafe usage of ->real_parent 2019-03-19 13:12:38 +01:00
cpufreq cpufreq: Avoid cpufreq_suspend() deadlock on system shutdown 2019-10-29 09:20:08 +01:00
cpuidle cpuidle: big.LITTLE: fix refcount leak 2019-02-12 19:47:08 +01:00
crypto net: use skb_queue_empty_lockless() in busy poll contexts 2019-11-10 11:27:49 +01:00
dax mm/huge_memory: fix vmf_insert_pfn_{pmd, pud}() crash, handle unaligned addresses 2019-05-22 07:37:40 +02:00
dca
devfreq PM / devfreq: tegra: Fix kHz to Hz conversion 2019-10-11 18:20:46 +02:00
dio
dma dmaengine: sprd: Fix the possible memory leak issue 2019-11-12 19:20:54 +01:00
dma-buf dma-buf/sw_sync: Synchronize signal vs syncpt free 2019-10-07 18:57:04 +02:00
edac EDAC/ghes: Fix Use after free in ghes_edac remove path 2019-10-29 09:20:01 +01:00
eisa
extcon extcon: arizona: Disable mic detect if running when driver is removed 2019-05-31 06:46:23 -07:00
firewire
firmware efi/cper: Fix endianness of PCIe class code 2019-11-06 13:05:52 +01:00
fmc
fpga fpga: altera-ps-spi: Fix getting of optional confd gpio 2019-09-21 07:16:53 +02:00
fsi fsi: scom: Don't abort operations for minor errors 2019-09-06 10:22:19 +02:00
gnss gnss: sirf: fix premature wakeup interrupt enable 2019-03-10 07:17:21 +01:00
gpio gpio: max77620: Use correct unit for debounce times 2019-11-06 13:05:50 +01:00
gpu drm/radeon: fix si_enable_smc_cac() failed issue 2019-11-12 19:20:38 +01:00
hid HID: intel-ish-hid: fix wrong error handling in ishtp_cl_alloc_tx_ring() 2019-11-12 19:20:54 +01:00
hsi
hv Drivers: hv: kvp: Fix the recent regression caused by incorrect clean-up 2019-09-16 08:21:54 +02:00
hwmon hwmon: (acpi_power_meter) Change log level for 'unsafe software power cap' 2019-10-05 13:09:54 +02:00
hwspinlock
hwtracing intel_th: pci: Add Jasper Lake PCH support 2019-11-12 19:20:42 +01:00
i2c i2c: stm32f7: remove warning when compiling with W=1 2019-11-10 11:27:33 +01:00
ide ide: fix a typo in the settings proc file name 2019-01-31 08:14:42 +01:00
idle x86/cpu: Sanitize FAM6_ATOM naming 2019-05-14 19:17:53 +02:00
iio iio: srf04: fix wrong limitation in distance measuring 2019-11-12 19:20:40 +01:00
infiniband RDMA/hns: Prevent memory leaks of eq->buf_list 2019-11-12 19:21:10 +01:00
input Input: synaptics-rmi4 - avoid processing unknown IRQs 2019-10-29 09:19:51 +01:00
iommu iommu/amd: Override wrong IVRS IOAPIC on Raven Ridge systems 2019-10-05 13:09:59 +02:00
ipack
irqchip irqchip/gic-v3-its: Use the exact ITSList for VMOVP 2019-11-10 11:27:31 +01:00
isdn net: use skb_queue_empty_lockless() in poll() handlers 2019-11-10 11:27:48 +01:00
leds led: triggers: Fix a memory leak bug 2019-10-05 13:09:45 +02:00
lightnvm lightnvm: pblk: fix freeing of merged pages 2019-07-26 09:14:09 +02:00
macintosh
mailbox mbox: qcom: add APCS child device for QCS404 2019-10-07 18:57:02 +02:00
mcb
md bcache: fix input overflow to writeback_rate_minimum 2019-11-06 13:05:20 +01:00
media media: vimc: Remove unused but set variables 2019-11-06 13:05:37 +01:00
memory memory: tegra: Fix integer overflow on tick value calculation 2019-05-25 18:23:32 +02:00
memstick memstick: jmb38x_ms: Fix an error handling path in 'jmb38x_ms_probe()' 2019-10-29 09:20:07 +01:00
message
mfd mfd: intel-lpss: Remove D3cold delay 2019-10-07 18:57:08 +02:00
misc mei: avoid FW version request on Ibex Peak and earlier 2019-10-17 13:45:10 -07:00
mmc mmc: cqhci: Commit descriptors before setting the doorbell 2019-10-29 09:19:57 +01:00
mtd mtd: cfi_cmdset_0002: Use chip_good() to retry in do_write_oneword() 2019-10-01 08:26:02 +02:00
mux
net macsec: fix refcnt leak in module exit routine 2019-11-12 19:21:02 +01:00
nfc NFC: st21nfca: fix double free 2019-11-12 19:20:30 +01:00
ntb ntb: point to right memory window index 2019-10-11 18:21:18 +02:00
nubus
nvdimm libnvdimm/region: Initialize bad block for volatile namespaces 2019-10-11 18:21:20 +02:00
nvme nvme-multipath: fix possible io hang after ctrl reconnect 2019-11-12 19:21:11 +01:00
nvmem nvmem: Use the same permissions for eeprom as for nvmem 2019-09-19 09:09:41 +02:00
of of: unittest: fix memory leak in unittest_data_add 2019-11-10 11:27:30 +01:00
opp OPP: Use opp_table->regulators to verify no regulator case 2019-02-12 19:47:08 +01:00
oprofile
parisc parisc: Disable HP HSC-PCI Cards to prevent kernel crash 2019-10-05 13:10:04 +02:00
parport parport: Fix mem leak in parport_register_dev_model 2019-06-25 11:35:55 +08:00
pci PCI: tegra: Enable Relaxed Ordering only for Tegra20 & Tegra30 2019-11-12 19:20:52 +01:00
pcmcia
perf drivers/perf: arm_pmu: Fix failure path in PM notifier 2019-08-06 19:06:55 +02:00
phy phy: renesas: rcar-gen3-usb2: Disable clearing VBUS in over-current 2019-09-21 07:16:42 +02:00
pinctrl pinctrl: ns2: Fix off by one bugs in ns2_pinmux_enable() 2019-11-10 11:27:17 +01:00
platform platform/x86: pmc_atom: Add Siemens SIMATIC IPC227E to critclk_systems DMI table 2019-11-10 11:27:55 +01:00
pnp
power power: supply: max14656: fix potential use-after-free 2019-11-06 13:05:39 +01:00
powercap x86/cpu: Sanitize FAM6_ATOM naming 2019-05-14 19:17:53 +02:00
pps drivers/pps/pps.c: clear offset flags in PPS_SETPARAMS ioctl 2019-08-04 09:30:56 +02:00
ps3
ptp ptp: Fix pass zero to ERR_PTR() in ptp_clock_register 2019-02-12 19:47:01 +01:00
pwm pwm: stm32-lp: Add check in case requested period cannot be achieved 2019-10-11 18:21:17 +02:00
rapidio drivers/rapidio/devices/rio_mport_cdev.c: NUL terminate some strings 2019-08-06 19:06:52 +02:00
ras RAS/CEC: Fix pfn insertion 2019-07-26 09:14:05 +02:00
regulator regulator: pfuze100-regulator: Variable "val" in pfuze100_regulator_probe() could be uninitialized 2019-11-10 11:27:15 +01:00
remoteproc remoteproc: qcom: q6v5-mss: add SCM probe dependency 2019-09-16 08:21:48 +02:00
reset reset: meson-audio-arb: Fix missing .owner setting of reset_controller_dev 2019-05-08 07:21:47 +02:00
rpmsg
rtc rtc: pcf8523: set xtal load capacitance from DT 2019-11-06 13:05:33 +01:00
s390 scsi: zfcp: fix reaction on bit error threshold notification 2019-10-29 09:19:48 +01:00
sbus drivers/sbus/char: add of_node_put() 2018-12-21 14:15:17 +01:00
scsi scsi: qla2xxx: stop timer in shutdown path 2019-11-12 19:21:10 +01:00
sfi
sh
siox
slimbus slimbus: fix a potential NULL pointer dereference in of_qcom_slim_ngd_register 2019-05-31 06:46:14 -07:00
sn
soc soc: bcm: brcmstb: biuctrl: Register writes require a barrier 2019-07-14 08:11:03 +02:00
soundwire soundwire: bus: set initial value to port_status 2019-11-12 19:20:38 +01:00
spi spi: spi-gpio: fix SPI_CS_HIGH capability 2019-09-16 08:22:07 +02:00
spmi
ssb ssb: Fix possible NULL pointer dereference in ssb_host_pcmcia_exit 2019-05-31 06:46:04 -07:00
staging staging: rtl8188eu: fix null dereference when kzalloc fails 2019-11-06 13:05:45 +01:00
target scsi: target: core: Do not overwrite CDB byte 1 2019-11-10 11:27:28 +01:00
tc
tee tee: optee: avoid possible double list_del() 2019-02-12 19:47:08 +01:00
thermal thermal_hwmon: Sanitize thermal_zone type 2019-10-11 18:21:19 +02:00
thunderbolt thunderbolt: Use 32-bit writes when writing ring producer/consumer 2019-11-06 13:06:12 +01:00
tty 8250-men-mcb: fix error checking when get_num_ports returns -ENODEV 2019-11-10 11:27:25 +01:00
uio
usb USB: ldusb: use unsigned size format specifiers 2019-11-12 19:21:08 +01:00
uwb
vfio vfio_pci: Restore original state on release 2019-10-07 18:56:53 +02:00
vhost vhost: make sure log_num < in_num 2019-09-16 08:22:25 +02:00
video video: ssd1307fb: Start page range at page_offset 2019-10-07 18:56:30 +02:00
virt virt: vbox: fix memory leak in hgcm_call_preprocess_linaddr 2019-11-06 13:06:04 +01:00
virtio virtio_pci: fix a NULL pointer reference in vp_del_vqs 2019-05-10 17:54:08 +02:00
visorbus
vlynq
vme
w1 w1: fix the resume command API 2019-05-31 06:46:14 -07:00
watchdog watchdog: aspeed: Add support for AST2600 2019-10-11 18:21:15 +02:00
xen xen/pci: reserve MCFG areas earlier 2019-10-11 18:21:13 +02:00
zorro
Kconfig
Makefile