TencentOS-kernel/drivers
Dan Williams 130799d8cc dm/dax: Fix table reference counts
commit 02186d8897d49b0afd3c80b6cf23437d91024065 upstream.

A recent fix to the dm_dax_supported() flow uncovered a latent bug. When
dm_get_live_table() fails it is still required to drop the
srcu_read_lock(). Without this change the lvm2 test-suite triggers this
warning:

    # lvm2-testsuite --only pvmove-abort-all.sh

    WARNING: lock held when returning to user space!
    5.9.0-rc5+ #251 Tainted: G           OE
    ------------------------------------------------
    lvm/1318 is leaving the kernel with locks still held!
    1 lock held by lvm/1318:
     #0: ffff9372abb5a340 (&md->io_barrier){....}-{0:0}, at: dm_get_live_table+0x5/0xb0 [dm_mod]

...and later on this hang signature:

    INFO: task lvm:1344 blocked for more than 122 seconds.
          Tainted: G           OE     5.9.0-rc5+ #251
    "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    task:lvm             state:D stack:    0 pid: 1344 ppid:     1 flags:0x00004000
    Call Trace:
     __schedule+0x45f/0xa80
     ? finish_task_switch+0x249/0x2c0
     ? wait_for_completion+0x86/0x110
     schedule+0x5f/0xd0
     schedule_timeout+0x212/0x2a0
     ? __schedule+0x467/0xa80
     ? wait_for_completion+0x86/0x110
     wait_for_completion+0xb0/0x110
     __synchronize_srcu+0xd1/0x160
     ? __bpf_trace_rcu_utilization+0x10/0x10
     __dm_suspend+0x6d/0x210 [dm_mod]
     dm_suspend+0xf6/0x140 [dm_mod]

Fixes: 7bf7eac8d648 ("dax: Arrange for dax_supported check to span multiple devices")
Cc: <stable@vger.kernel.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Alasdair Kergon <agk@redhat.com>
Cc: Mike Snitzer <snitzer@redhat.com>
Reported-by: Adrian Huang <ahuang12@lenovo.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Tested-by: Adrian Huang <ahuang12@lenovo.com>
Link: https://lore.kernel.org/r/160045867590.25663.7548541079217827340.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-16 16:36:22 +08:00
..
accessibility Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
acpi ACPICA: Do not increment operation_region reference counts for field units 2021-03-16 16:33:26 +08:00
amba Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
android binder: Prevent context manager from incrementing ref 0 2021-03-16 16:33:03 +08:00
ata libata: implement ATA_HORKAGE_MAX_TRIM_128M and apply to Sandisks 2021-03-16 16:35:42 +08:00
atm firestream: Fix memleak in fs_open 2021-03-16 16:35:54 +08:00
auxdisplay Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
base firmware_loader: fix memory leak for paged buffer 2021-03-16 16:36:11 +08:00
bcma Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
block rbd: require global CAP_SYS_ADMIN for mapping and unmapping 2021-03-16 16:36:06 +08:00
bluetooth Bluetooth: hci_serdev: Only unregister device if it was registered 2021-03-16 16:33:41 +08:00
bus bus: ti-sysc: Add missing quirk flags for usb_host_hs 2021-03-16 16:33:21 +08:00
cdrom Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
char tpm: Unify the mismatching TPM space buffer sizes 2021-03-16 16:33:55 +08:00
clk clk: rockchip: Fix initialization of mux_pll_src_4plls_p 2021-03-16 16:36:15 +08:00
clocksource arm64: arch_timer: Disable the compat vdso for cores affected by ARM64_WORKAROUND_1418040 2021-03-16 16:31:46 +08:00
connector Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
counter counter: 104-quad-8: Add lock guards - generic interface 2021-03-16 16:27:07 +08:00
cpufreq cpufreq: intel_pstate: Fix intel_pstate_get_hwp_max() for turbo disabled 2021-03-16 16:35:59 +08:00
cpuidle cpuidle: Fixup IRQ state 2021-03-16 16:35:25 +08:00
crypto crypto: caam - Remove broken arc4 support 2021-03-16 16:34:14 +08:00
dax device-dax: don't leak kernel memory to user space after unloading kmem 2021-03-16 16:28:19 +08:00
dca Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
devfreq PM / devfreq: rk3399_dmc: Fix kernel oops when rockchip,pmu is absent 2021-03-16 16:34:55 +08:00
dio Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
dma drivers/dma/dma-jz4780: Fix race condition between probe and irq handler 2021-03-16 16:35:55 +08:00
dma-buf dmabuf: use spinlock to access dmabuf->name 2021-03-16 16:32:21 +08:00
edac EDAC/{i7core,sb,pnd2,skx}: Fix error event severity 2021-03-16 16:34:59 +08:00
eisa Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
extcon extcon: adc-jack: Fix an error handling path in 'adc_jack_probe()' 2021-03-16 16:30:26 +08:00
firewire Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
firmware efi: add missed destroy_workqueue when efisubsys_init fails 2021-03-16 16:34:41 +08:00
fpga fpga: dfl: fix bug in port reset handshake 2021-03-16 16:32:23 +08:00
fsi Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
gnss gnss: sirf: fix error return code in sirf_probe() 2021-03-16 16:29:47 +08:00
gpio gpio: arizona: put pm_runtime in case of failure 2021-03-16 16:32:18 +08:00
gpu drm/i915: Filter wake_flags passed to default_wake_function 2021-03-16 16:36:19 +08:00
greybus Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
hid HID: elan: Fix memleak in elan_input_configured 2021-03-16 16:35:58 +08:00
hsi Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
hv Drivers: hv: vmbus: Add timeout to vmbus_wait_for_unload 2021-03-16 16:36:17 +08:00
hwmon hwmon: (applesmc) check status earlier. 2021-03-16 16:35:24 +08:00
hwspinlock Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
hwtracing coresight: tmc: Fix TMC mode read in tmc_read_unprepare_etb() 2021-03-16 16:33:38 +08:00
i2c i2c: i801: Fix resume bug 2021-03-16 16:36:20 +08:00
i3c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ide Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
idle Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
iio iio:accel:mma8452: Fix timestamp alignment and prevent data leak. 2021-03-16 16:36:03 +08:00
infiniband RDMA/bnxt_re: Restrict the max_gids to 256 2021-03-16 16:36:10 +08:00
input Input: i8042 - add Entroware Proteus EL07R4 to nomux and reset lists 2021-03-16 16:36:21 +08:00
interconnect Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
iommu iommu/amd: Fix potential @entry null deref 2021-03-16 16:36:19 +08:00
ipack ipack: tpci200: fix error return code in tpci200_register() 2021-03-16 16:28:19 +08:00
irqchip irqchip/stm32-exti: Avoid losing interrupts due to clearing pending bits by mistake 2021-03-16 16:35:14 +08:00
isdn Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
leds leds: core: Flush scheduled work for system suspend 2021-03-16 16:33:33 +08:00
lightnvm Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
macintosh macintosh/via-macii: Access autopoll_devs when inside lock 2021-03-16 16:33:39 +08:00
mailbox mailbox: zynqmp-ipi: Fix NULL vs IS_ERR() check in zynqmp_ipi_mbox_probe() 2021-03-16 16:30:27 +08:00
mcb Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
md dm/dax: Fix table reference counts 2021-03-16 16:36:22 +08:00
media media: rc: uevent sysfs file races with rc_unregister_device() 2021-03-16 16:35:41 +08:00
memory Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
memstick Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
message scsi: mptscsih: Fix read sense data size 2021-03-16 16:31:28 +08:00
mfd mfd: intel-lpss: Add Intel Tiger Lake PCH-H PCI IDs 2021-03-16 16:34:47 +08:00
misc habanalabs: check correct vmalloc return code 2021-03-16 16:35:25 +08:00
mmc mmc: sdhci-of-esdhc: Don't walk device-tree on every interrupt 2021-03-16 16:36:06 +08:00
mtd mtd: rawnand: fsl_upm: Remove unused mtd var 2021-03-16 16:34:11 +08:00
mux Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
net hv_netvsc: Remove "unlikely" from netvsc_select_queue 2021-03-16 16:36:11 +08:00
nfc NFC: st95hf: Fix memleak in st95hf_in_send_cmd 2021-03-16 16:35:54 +08:00
ntb NTB: perf: Fix race condition when run with ntb_test 2021-03-16 16:30:32 +08:00
nubus Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
nvdimm libnvdimm/security: ensure sysfs poll thread woke up and fetch updated attr 2021-03-16 16:34:18 +08:00
nvme nvme-tcp: cancel async events before freeing event struct 2021-03-16 16:36:14 +08:00
nvmem nvmem: qfprom: remove incorrect write support 2021-03-16 16:28:52 +08:00
of of: of_mdio: Correct loop scanning logic 2021-03-16 16:31:51 +08:00
opp opp: Enable resources again if they were disabled earlier 2021-03-16 16:34:30 +08:00
oprofile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
parisc parisc: mask out enable and reserved bits from sba imask 2021-03-16 16:33:54 +08:00
parport Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
pci PCI: qcom: Add missing reset for ipq806x 2021-03-16 16:34:59 +08:00
pcmcia Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
perf drivers/perf: Prevent forced unbinding of PMU drivers 2021-03-16 16:32:34 +08:00
phy phy: qcom-qmp: Use correct values for ipq8074 PCIe Gen2 PHY init 2021-03-16 16:36:08 +08:00
pinctrl pinctrl: ingenic: Properly detect GPIO direction when configured for IRQ 2021-03-16 16:34:11 +08:00
platform platform/chrome: cros_ec_ishtp: Fix a double-unlock issue 2021-03-16 16:34:12 +08:00
pnp Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
power power: supply: check if calc_soc succeeded in pm860x_init_battery 2021-03-16 16:33:40 +08:00
powercap Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
pps Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ps3 Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ptp Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
pwm pwm: bcm-iproc: handle clk_get_rate() return 2021-03-16 16:34:17 +08:00
rapidio rapidio: Replace 'select' DMAENGINES 'with depends on' 2021-03-16 16:36:13 +08:00
ras Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
regulator regulator: pwm: Fix machine constraints application 2021-03-16 16:36:12 +08:00
remoteproc remoteproc: qcom_q6v5_mss: Validate modem blob firmware size before load 2021-03-16 16:34:10 +08:00
reset Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
rpmsg Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
rtc rtc: goldfish: Enable interrupt in set_alarm() when necessary 2021-03-16 16:34:31 +08:00
s390 s390/zcrypt: fix kmalloc 256k failure 2021-03-16 16:36:22 +08:00
sbus Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
scsi scsi: libsas: Fix error path in sas_notify_lldd_dev_found() 2021-03-16 16:36:16 +08:00
sfi Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sh Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
siox Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
slimbus slimbus: core: Fix mismatch in of_node_get/put 2021-03-16 16:32:05 +08:00
soc soc: qcom: rpmh-rsc: Set suppress_bind_attrs flag 2021-03-16 16:33:19 +08:00
soundwire soundwire: fix double free of dangling pointer 2021-03-16 16:35:51 +08:00
spi spi: Fix memory leak on splited transfers 2021-03-16 16:36:15 +08:00
spmi Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ssb Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
staging staging: greybus: audio: fix uninitialized value issue 2021-03-16 16:36:08 +08:00
target scsi: target: iscsi: Fix hang in iscsit_access_np() when getting tpg->np_login_sem 2021-03-16 16:36:05 +08:00
tc Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
tee Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
thermal thermal: qcom-spmi-temp-alarm: Don't suppress negative temp 2021-03-16 16:35:35 +08:00
thunderbolt Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
tty serial: 8250_pci: Add Realtek 816a and 816b 2021-03-16 16:36:21 +08:00
uio uio_pdrv_genirq: fix use without device tree and no interrupt 2021-03-16 16:32:12 +08:00
usb ehci-hcd: Move include to keep CRC stable 2021-03-16 16:36:22 +08:00
vfio vfio/pci: Fix SR-IOV VF handling with MMIO blocking 2021-03-16 16:35:44 +08:00
vhost vhost/scsi: fix up req type endian-ness 2021-03-16 16:32:46 +08:00
video fbcon: Fix user font detection test at fbcon_resize(). 2021-03-16 16:36:18 +08:00
virt virt: vbox: Fix guest capabilities mask check 2021-03-16 16:32:09 +08:00
virtio virtio_ring: Avoid loop when vq is broken in virtqueue_poll 2021-03-16 16:34:34 +08:00
visorbus Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
vlynq Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
vme Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
w1 w1: omap-hdq: cleanup to add missing newline for some dev_dbg 2021-03-16 16:29:53 +08:00
watchdog watchdog: initialize device before misc_register 2021-03-16 16:34:19 +08:00
xen xen/xenbus: Fix granting of vmalloc'd memory 2021-03-16 16:35:26 +08:00
zorro Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Kconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Makefile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00