WSL2-Linux-Kernel/drivers
Mikulas Patocka d71a0899e4 dm: send just one event on resize, not two
commit 7533afa1d2 upstream.

Device mapper sends an uevent when the device is suspended, using the
function set_capacity_and_notify. However, this causes a race condition
with udev.

Udev skips scanning dm devices that are suspended. If we send an uevent
while we are suspended, udev will be racing with device mapper resume
code. If the device mapper resume code wins the race, udev will process
the uevent after the device is resumed and it will properly scan the
device.

However, if udev wins the race, it will receive the uevent, find out that
the dm device is suspended and skip scanning the device. This causes bugs
such as systemd unmounting the device - see
https://bugzilla.redhat.com/show_bug.cgi?id=2158628

This commit fixes this race.

We replace the function set_capacity_and_notify with set_capacity, so that
the uevent is not sent at this point. In do_resume, we detect if the
capacity has changed and we pass a boolean variable need_resize_uevent to
dm_kobject_uevent. dm_kobject_uevent adds "RESIZE=1" to the uevent if
need_resize_uevent is set.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Tested-by: Peter Rajnoha <prajnoha@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-10 09:40:05 +01:00
..
accessibility tty: fix possible null-ptr-defer in spk_ttyio_release 2023-01-24 07:22:46 +01:00
acpi ACPI: video: Fix Lenovo Ideapad Z570 DMI match 2023-03-10 09:39:50 +01:00
amba
android binder: Gracefully handle BINDER_TYPE_FDA objects with num_fds=0 2023-02-25 12:06:45 +01:00
ata ata: libata: Fix sata_down_spd_limit() when no link speed is reported 2023-02-09 11:26:37 +01:00
atm atm: idt77252: fix use-after-free bugs caused by tst_timer 2022-08-25 11:40:15 +02:00
auxdisplay
base PM: domains: fix memory leak with using debugfs_lookup() 2023-03-10 09:39:51 +01:00
bcma
block brd: return 0/-error from brd_insert_page() 2023-03-10 09:40:02 +01:00
bluetooth Bluetooth: btusb: Add VID:PID 13d3:3529 for Realtek RTL8821CE 2023-03-10 09:39:51 +01:00
bus bus: sunxi-rsb: Fix error handling in sunxi_rsb_init() 2023-02-09 11:26:32 +01:00
cdrom
char ipmi_ssif: Rename idle state and check 2023-03-10 09:39:56 +01:00
clk clk: mxl: syscon_node_to_regmap() returns error pointers 2023-02-25 12:06:43 +01:00
clocksource clocksource/drivers/timer-ti-dm: Fix missing clk_disable_unprepare in dmtimer_systimer_init_clock() 2022-12-31 13:14:04 +01:00
comedi comedi: adv_pci1760: Fix PWM instruction handling 2023-01-24 07:22:45 +01:00
connector
counter counter: stm32-lptimer-cnt: fix the check on arr and cmp registers update 2022-12-31 13:14:30 +01:00
cpufreq cpufreq: governor: Use kobject release() method to free dbs_data 2023-02-01 08:27:29 +01:00
cpuidle cpuidle: dt: Return the correct numbers of parsed idle states 2022-12-31 13:14:01 +01:00
crypto crypto: qat - fix out-of-bounds read 2023-03-10 09:40:03 +01:00
cxl
dax devdax: Fix soft-reservation memory description 2022-09-28 11:11:57 +02:00
dca
devfreq PM/devfreq: governor: Add a private governor_data for governor 2023-01-12 11:58:51 +01:00
dio drivers: dio: fix possible memory leak in dio_init() 2022-12-31 13:14:27 +01:00
dma dmaengine: dw-axi-dmac: Do not dereference NULL structure 2023-03-10 09:39:42 +01:00
dma-buf dma-buf: fix racing conflict of dma_heap_add() 2022-12-02 17:41:06 +01:00
edac EDAC/qcom: Do not pass llcc_driv_data as edac_device_ctl_info's pvt_info 2023-02-01 08:27:25 +01:00
eisa
extcon extcon: usbc-tusb320: fix kernel-doc warning 2023-02-06 07:59:01 +01:00
firewire firewire: fix memory leak for payload of request subaction to IEC 61883-1 FCP region 2023-02-09 11:26:32 +01:00
firmware firmware: coreboot: framebuffer: Ignore reserved pixel color bits 2023-03-10 09:39:55 +01:00
fpga fpga: stratix10-soc: Fix return value check in s10_ops_write_init() 2023-02-09 11:26:44 +01:00
fsi WRITE is "data source", not destination... 2023-02-09 11:26:34 +01:00
gnss
gpio gpio: vf610: connect GPIO label to dev name 2023-03-10 09:39:27 +01:00
gpu drm/shmem-helper: Revert accidental non-GPL export 2023-03-10 09:39:55 +01:00
greybus
hid HID: logitech-hidpp: Don't restart communication if not necessary 2023-03-10 09:39:54 +01:00
hsi HSI: omap_ssi_core: Fix error handling in ssi_init() 2022-12-31 13:14:32 +01:00
hv video: hyperv_fb: Avoid taking busy spinlock on panic path 2022-12-31 13:14:39 +01:00
hwmon hwmon: (coretemp) Simplify platform device handling 2023-03-10 09:39:54 +01:00
hwspinlock hwspinlock: qcom: correct MMIO max register for newer SoCs 2022-11-16 09:58:13 +01:00
hwtracing coresight: cti: Add PM runtime call in enable_store 2023-03-10 09:39:36 +01:00
i2c i2c: designware: fix i2c_dw_clk_rate() return size to be u32 2023-03-10 09:39:34 +01:00
i3c
idle
iio iio: light: tsl2563: Do not hardcode interrupt trigger type 2023-03-10 09:39:34 +01:00
infiniband RDMA/siw: Fix user page pinning accounting 2023-03-10 09:40:00 +01:00
input Input: i8042 - add Clevo PCX0DX to i8042 quirk table 2023-02-09 11:26:41 +01:00
interconnect
iommu iommu/vt-d: Allow to use flush-queue when first level is default 2023-03-10 09:39:43 +01:00
ipack
irqchip irqchip/irq-bcm7120-l2: Set IRQ_LEVEL for level triggered interrupts 2023-03-10 09:39:18 +01:00
isdn mISDN: hfcmulti: don't call dev_kfree_skb/kfree_skb() under spin_lock_irqsave() 2022-12-31 13:14:37 +01:00
leds leds: led-core: Fix refcount leak in of_led_get() 2023-03-10 09:39:32 +01:00
macintosh macintosh/macio-adb: check the return value of ioremap() 2022-12-31 13:14:35 +01:00
mailbox mailbox: zynq-ipi: fix error handling while device_register() fails 2022-12-31 13:14:39 +01:00
mcb mcb: mcb-parse: fix error handing in chameleon_parse_gdd() 2022-12-31 13:14:30 +01:00
md dm: send just one event on resize, not two 2023-03-10 09:40:05 +01:00
media media: saa7134: Use video_unregister_device for radio_dev 2023-03-10 09:39:46 +01:00
memory memory: mvebu-devbus: Fix missing clk_disable_unprepare in mvebu_devbus_probe() 2023-02-01 08:27:03 +01:00
memstick memstick/ms_block: Add check for alloc_ordered_workqueue 2022-12-31 13:14:17 +01:00
message
mfd mfd: pcf50633-adc: Fix potential memleak in pcf50633_adc_async_read() 2023-03-10 09:39:34 +01:00
misc misc/mei/hdcp: Use correct macros to initialize uuid_le 2023-03-10 09:39:38 +01:00
mmc mmc: mmc_spi: fix error handling in mmc_spi_probe() 2023-02-22 12:57:06 +01:00
most
mtd mtd: spi-nor: Fix shift-out-of-bounds in spi_nor_set_erase_type 2023-03-10 09:40:05 +01:00
mux
net wifi: rtl8xxxu: fixing transmisison failure for rtl8192eu 2023-03-10 09:39:55 +01:00
nfc nfc: pn533: Wait for out_urb's completion in pn533_usb_send_frame() 2023-01-18 11:48:54 +01:00
ntb NTB: ntb_tool: uninitialized heap data in tool_fn_write() 2022-08-25 11:40:14 +02:00
nubus
nvdimm
nvme nvme-fc: fix a missing queue put in nvmet_fc_ls_create_association 2023-02-22 12:57:02 +01:00
nvmem nvmem: core: fix return value 2023-02-22 12:57:03 +01:00
of of: reserved_mem: Have kmemleak ignore dynamically allocated reserved mem 2023-02-22 12:57:07 +01:00
opp OPP: fix error checking in opp_migrate_dentry() 2023-03-10 09:39:15 +01:00
parisc parisc: led: Fix potential null-ptr-deref in start_task() 2023-01-12 11:58:59 +01:00
parport parport_pc: Avoid FIFO port location truncation 2022-11-26 09:24:36 +01:00
pci PCI: switchtec: Return -EFAULT for copy_to_user() errors 2023-03-10 09:39:37 +01:00
pcmcia
perf perf/smmuv3: Fix hotplug callback leak in arm_smmu_pmu_init() 2022-12-31 13:13:58 +01:00
phy phy: rockchip-typec: fix tcphy_get_mode error case 2023-03-10 09:39:42 +01:00
pinctrl pinctrl: at91: use devm_kasprintf() to avoid potential leaks 2023-03-10 09:39:54 +01:00
platform platform/x86/amd: pmc: add CONFIG_SERIO dependency 2023-02-22 12:57:11 +01:00
pnp PNP: fix name memory leak in pnp_alloc_dev() 2022-12-31 13:14:02 +01:00
power power: supply: remove faulty cooling logic 2023-03-10 09:39:41 +01:00
powercap powercap: fix possible name leak in powercap_register_zone() 2023-03-10 09:39:12 +01:00
pps
ps3
ptp
pwm pwm: tegra: Fix 32 bit build 2022-12-31 13:14:48 +01:00
rapidio rapidio: devices: fix missing put_device in mport_cdev_open 2022-12-31 13:14:05 +01:00
ras
regulator regulator: s5m8767: Bounds check id indexing into arrays 2023-03-10 09:39:53 +01:00
remoteproc remoteproc: qcom_q6v5_mss: Use a carveout to authenticate modem headers 2023-03-10 09:39:43 +01:00
reset reset: uniphier-glue: Fix possible null-ptr-deref 2023-02-01 08:27:04 +01:00
rpmsg rpmsg: glink: Avoid infinite loop on intent for missing channel 2023-03-10 09:39:46 +01:00
rtc rtc: pm8xxx: fix set-alarm race 2023-03-10 09:39:55 +01:00
s390 s390/dasd: Fix potential memleak in dasd_eckd_init() 2023-03-10 09:39:04 +01:00
sbus
scsi scsi: snic: Fix memory leak with using debugfs_lookup() 2023-03-10 09:39:54 +01:00
sh
siox siox: fix possible memory leak in siox_device_add() 2022-11-26 09:24:36 +01:00
slimbus slimbus: stream: correct presence rate frequencies 2022-11-26 09:24:44 +01:00
soc PM: AVS: qcom-cpr: Fix an error handling path in cpr_probe() 2023-02-01 08:27:06 +01:00
soundwire soundwire: cadence: Don't overflow the command FIFOs 2023-03-10 09:39:35 +01:00
spi spi: synquacer: Fix timeout handling in synquacer_spi_transfer_one() 2023-03-10 09:39:31 +01:00
spmi spmi: pmic-arb: correct duplicate APID to PPID mapping logic 2022-10-26 12:35:19 +02:00
ssb
staging staging: mt7621-dts: change palmbus address to lower case 2023-03-03 11:45:53 +01:00
target scsi: target: core: Fix warning on RT kernels 2023-02-09 11:26:39 +01:00
tc
tee tee: optee: fix possible memory leak in optee_register_device() 2022-12-02 17:41:03 +01:00
thermal thermal: intel: intel_pch: Add support for Wellsburg PCH 2023-03-10 09:39:49 +01:00
thunderbolt thunderbolt: Use correct function to calculate maximum USB3 link rate 2023-01-24 07:22:46 +01:00
tty tty: serial: imx: disable Ageing Timer interrupt request irq 2023-03-10 09:39:41 +01:00
uio uio: uio_dmem_genirq: Fix deadlock between irq config and handling 2022-12-31 13:14:27 +01:00
usb usb: max-3421: Fix setting of I/O pins 2023-03-10 09:39:41 +01:00
vdpa vduse: Validate vq_num in vduse_validate_config() 2023-01-24 07:22:41 +01:00
vfio vfio: platform: Do not pass return buffer to ACPI _RST method 2022-12-31 13:14:27 +01:00
vhost vhost/net: Clear the pending messages when the backend is removed 2023-02-09 11:26:34 +01:00
video Revert "fbcon: don't lose the console font across generic->chip driver switch" 2023-03-10 09:39:52 +01:00
virt vboxguest: Do not use devm for irq 2022-08-25 11:40:33 +02:00
virtio virtio_pci: modify ENOENT to EINVAL 2023-01-24 07:22:41 +01:00
visorbus
vlynq
vme vme: Fix error not catched in fake_init() 2022-12-31 13:14:30 +01:00
w1 w1: fix WARNING after calling w1_process() 2023-02-01 08:27:14 +01:00
watchdog watchdog: diag288_wdt: fix __diag288() inline assembly 2023-02-09 11:26:41 +01:00
xen fix "direction" argument of iov_iter_kvec() 2023-02-09 11:26:34 +01:00
zorro
Kconfig
Makefile