linux/drivers
Ming Lei 7fc4da6a30 ublk: scan partition in async way
Implement async partition scan to avoid IO hang when reading partition
tables. Similar to nvme_partition_scan_work(), partition scanning is
deferred to a work queue to prevent deadlocks.

When partition scan happens synchronously during add_disk(), IO errors
can cause the partition scan to wait while holding ub->mutex, which
can deadlock with other operations that need the mutex.

Changes:
- Add partition_scan_work to ublk_device structure
- Implement ublk_partition_scan_work() to perform async scan
- Always suppress sync partition scan during add_disk()
- Schedule async work after add_disk() for trusted daemons
- Add flush_work() in ublk_stop_dev() before grabbing ub->mutex

Reviewed-by: Caleb Sander Mateos <csander@purestorage.com>
Reported-by: Yoav Cohen <yoav@nvidia.com>
Closes: https://lore.kernel.org/linux-block/DM4PR12MB63280C5637917C071C2F0D65A9A8A@DM4PR12MB6328.namprd12.prod.outlook.com/
Fixes: 71f28f3136 ("ublk_drv: add io_uring based userspace block driver")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
History 2025-12-28 09:25:26 -07:00
..
accel accel/qaic: Synchronize access to DBC request queue head & tail pointer 2025-10-14 08:56:31 -06:00
accessibility treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
acpi Thermal control updates for 6.19-rc1 2025-12-02 17:49:12 -08:00
amba PM: domains: Add flags to specify power on attach/detach 2025-07-07 20:41:20 +02:00
android Networking changes for 6.19. 2025-12-03 17:24:33 -08:00
ata ata: libata-core: Set capacity to zero for a security locked drive 2025-11-20 13:37:18 +01:00
atm atm/fore200e: Fix possible data race in fore200e_open() 2025-11-25 12:39:26 +01:00
auxdisplay treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
base Power management updates for 6.19-rc1 2025-12-02 17:31:22 -08:00
bcma bcma: don't register devices disabled in OF 2025-10-20 13:54:15 +02:00
block ublk: scan partition in async way 2025-12-28 09:25:26 -07:00
bluetooth Bluetooth: btusb: Add new VID/PID 13d3/3533 for RTL8821CE 2025-12-01 16:21:16 -05:00
bus treewide: Remove in_irq() 2025-10-24 21:39:27 +02:00
cache cache: sifive_ccache: Optimize cache flushes 2025-09-11 19:13:21 +01:00
cdrom cdrom: Call cdrom_mrw_exit from cdrom_release function 2025-07-22 19:10:17 -06:00
cdx Char/Misc/IIO/Binder changes for 6.18-rc1 2025-10-04 16:26:32 -07:00
char printk changes for 6.19 2025-12-03 12:42:36 -08:00
clk clk: sunxi-ng: sun55i-a523-ccu: Lower audio0 pll minimum rate 2025-10-23 02:06:47 +08:00
clocksource clocksource/drivers: Add Realtek system timer driver 2025-11-26 11:25:15 +01:00
comedi comedi: fix divide-by-zero in comedi_buf_munge() 2025-10-22 08:03:52 +02:00
connector connector/cn_proc: revert "connector: Fix proc_event_num_listeners count not cleared" 2024-02-13 11:15:44 +01:00
counter counter: microchip-tcb-capture: Allow shared IRQ for multi-channel TCBs 2025-10-13 14:56:30 +09:00
cpufreq CPUFreq updates for 6.19 2025-11-25 17:06:04 +01:00
cpuidle Merge branches 'pm-qos' and 'pm-tools' 2025-11-28 16:50:45 +01:00
crypto Networking changes for 6.19. 2025-12-03 17:24:33 -08:00
cxl cxl: Adjust offset calculation for poison injection 2025-11-07 09:22:10 -07:00
dax Coccinelle-based conversion to use ->i_state accessors 2025-10-20 20:22:26 +02:00
dca Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
devfreq PM / devfreq: Fix typo in DFSO_DOWNDIFFERENTIAL macro name 2025-11-26 13:58:59 +09:00
dibs dibs: Remove KMSG_COMPONENT macro 2025-11-27 18:11:43 -08:00
dio dio: Have dio_bus_match() callback take a const * 2024-07-10 15:38:14 +02:00
dma dmaengine updates for v6.18 2025-10-06 10:37:06 -07:00
dma-buf printk changes for 6.19 2025-12-03 12:42:36 -08:00
dpll tools: ynl-gen: add regeneration comment 2025-11-25 19:20:42 -08:00
edac - imh_edac: Add a new EDAC driver for Intel Diamond Rapids and 2025-12-02 10:45:50 -08:00
eisa EISA: Move devlist.h out of obj to always 2025-05-07 07:01:01 +02:00
extcon extcon: max14526: depends on I2C to prevent build warning/errors 2025-09-08 15:13:06 +09:00
firewire firewire: core: fix to update generation field in topology map 2025-11-16 21:30:26 +09:00
firmware arm64 updates for 6.19: 2025-12-02 17:03:55 -08:00
fpga fpga: zynq_fpga: Fix the wrong usage of dma_map_sgtable() 2025-08-19 12:54:45 +02:00
fsi Driver core changes for 6.17-rc1 2025-07-29 12:15:39 -07:00
fwctl pds_fwctl: Replace kzalloc + copy_from_user with memdup_user in pdsfc_fw_rpc 2025-09-22 10:33:10 -03:00
gnss [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
gpio vfs-6.19-rc1.fd_prepare.fs 2025-12-01 17:32:07 -08:00
gpu Kbuild updates for v6.19 2025-12-03 14:42:21 -08:00
greybus greybus: svc: use string choice helpers instead of ternary operator 2025-08-19 12:50:31 +02:00
hid Input updates for v6.18-rc6 2025-11-22 09:58:41 -08:00
hsi HSI: omap_ssi_port: Remove redundant pm_runtime_mark_last_busy() calls 2025-09-05 22:56:59 +02:00
hte treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
hv A large overhaul of the restartable sequences and CID management: 2025-12-02 08:48:53 -08:00
hwmon hwmon: (gpd-fan) initialize EC on driver load for Win 4 2025-11-12 11:54:37 -08:00
hwspinlock hwspinlock: Remove unused hwspin_lock_get_id() 2025-03-21 17:12:04 -05:00
hwtracing coresight: trbe: Request specific affinities for per CPU interrupts 2025-10-27 17:16:36 +01:00
i2c i2c: muxes: pca954x: Fix broken reset-gpio usage 2025-11-03 18:04:15 +01:00
i3c i3c: fix big-endian FIFO transfers 2025-09-29 00:17:22 +02:00
idle intel_idle: Remove unnecessary address-of operators 2025-09-01 17:32:25 +02:00
iio iio: accel: bmc150: Fix irq assumption regression 2025-11-11 20:22:23 +00:00
infiniband Networking changes for 6.19. 2025-12-03 17:24:33 -08:00
input Linux 6.18-rc6 2025-11-17 23:16:55 -08:00
interconnect Merge branch 'icc-glymur' into icc-next 2025-09-12 13:54:17 +03:00
iommu dma-mapping fixes for Linux 6.18 2025-11-27 17:29:15 -08:00
ipack driver core: have match() callback in struct bus_type take a const * 2024-07-03 15:16:54 +02:00
irqchip Updates for [PCI] MSI related code: 2025-12-02 09:35:59 -08:00
isdn isdn: kcapi: add WQ_PERCPU to alloc_workqueue users 2025-11-10 18:14:20 -08:00
leds leds: led-class: Add Device Tree support to led_get() 2025-09-16 16:49:28 +01:00
macintosh treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
mailbox mailbox: th1520: fix clock imbalance on probe failure 2025-11-28 09:47:44 -06:00
mcb mcb: use sysfs_emit_at() instead of scnprintf() in show functions 2025-07-16 14:17:07 +02:00
md bcache: fix improper use of bi_end_io 2025-12-09 10:20:03 -07:00
media Random number generator updates for Linux 6.19-rc1. 2025-12-02 19:00:26 -08:00
memory memory: tegra210: Fix incorrect client ids 2025-10-23 15:32:21 +02:00
memstick Summary of significant series in this pull request: 2025-10-02 18:18:33 -07:00
message scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
mfd mfd: ls2kbmc: check for devm_mfd_add_devices() failure 2025-10-03 10:38:23 -05:00
misc vfs-6.19-rc1.fd_prepare.fs 2025-12-01 17:32:07 -08:00
mmc printk changes for 6.19 2025-12-03 12:42:36 -08:00
most most: usb: fix double free on late probe failure 2025-11-09 11:15:20 +09:00
mtd mtd: onenand: Pass correct pointer to IRQ handler 2025-11-03 11:37:57 +01:00
mux hardening updates for v6.17-rc1 2025-07-28 17:16:12 -07:00
net Networking changes for 6.19. 2025-12-03 17:24:33 -08:00
nfc NFC: mei_phy: fix kernel-doc warnings 2025-11-17 19:32:32 -08:00
ntb NTB: epf: Add Renesas rcar support 2025-09-22 09:35:21 -04:00
nubus nubus: Make nubus_bus_type static and constant 2024-01-03 13:33:59 +01:00
nvdimm libnvdimm for 6.18 2025-10-06 11:17:18 -07:00
nvme nvme updates for Linux 6.19 2025-12-04 20:58:19 -07:00
nvmem nvmem: layouts: fix nvmem_layout_bus_uevent 2025-11-24 18:08:10 +01:00
of Updates for the interrupt core and treewide cleanups: 2025-12-02 09:14:26 -08:00
opp OPP: Initialize scope-based pointers inline 2025-10-23 11:58:05 +05:30
parisc char: misc: Register fixed minor EISA_EEPROM_MINOR in linux/miscdevice.h 2025-08-19 12:41:18 +02:00
parport treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
pci Networking changes for 6.19. 2025-12-03 17:24:33 -08:00
pcmcia pcmcia: Add error handling for add_interval() in do_validate_mem() 2025-08-16 15:49:58 +02:00
peci peci: remove unneeded 'fast_io' parameter in regmap_config 2025-08-28 22:43:23 +02:00
perf arm64 updates for 6.19: 2025-12-02 17:03:55 -08:00
phy phy-for-6.18 2025-10-06 10:34:22 -07:00
pinctrl pinctrl: s32cc: initialize gpio_pin_config::list after kmalloc() 2025-11-18 23:56:11 +01:00
platform platform-drivers-x86 for v6.18-5 2025-11-27 08:51:36 -08:00
pmdomain Power management updates for 6.19-rc1 2025-12-02 17:31:22 -08:00
pnp PNP: Fix ISAPNP to generate uevents to auto-load modules 2025-11-18 17:35:36 +01:00
power Fix Intel Dollar Cove TI battery driver 32-bit build error 2025-11-26 12:31:48 -08:00
powercap powercap: intel_rapl: Enable MSR-based RAPL PMU support 2025-11-21 21:47:08 +01:00
pps printk changes for 6.19 2025-12-03 12:42:36 -08:00
ps3 powerpc/ps3: Use str_write_read() in ps3stor_read_write_sectors() 2025-09-06 17:01:26 +05:30
ptp Networking changes for 6.19. 2025-12-03 17:24:33 -08:00
pwm pwm: adp5585: Correct mismatched pwm chip info 2025-11-14 11:55:56 +01:00
rapidio Merge 6.16-rc3 into driver-core-next 2025-06-23 07:53:36 +02:00
ras Merge remote-tracking branches 'ras/edac-amd-atl', 'ras/edac-drivers' and 'ras/edac-misc' into edac-updates 2025-12-01 12:06:08 +01:00
regulator regulator: rtq2208: Correct LDO2 logic judgment bits 2025-11-27 11:41:00 +00:00
remoteproc remoteproc updates for v6.18 2025-10-04 15:45:17 -07:00
resctrl arm_mpam: Add kunit tests for props_mismatch() 2025-11-19 18:34:24 +00:00
reset reset: imx8mp-audiomix: Fix bad mask values 2025-11-05 16:12:28 +01:00
rpmsg rpmsg: qcom_smd: Fix fallback to qcom,ipc parse 2025-09-20 21:29:48 -05:00
rtc rtc: rx8025: fix incorrect register reference 2025-11-08 20:56:12 +01:00
s390 for-6.19/block-20251201 2025-12-03 19:26:18 -08:00
sbus Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
scsi scsi: sd: reject invalid pr_read_keys() num_keys values 2025-12-04 07:19:26 -07:00
sh sh: Switch to irq_domain_create_*() 2025-05-16 21:06:11 +02:00
siox siox: bus-gpio: Remove the use of dev_err_probe() 2025-09-06 15:59:59 +02:00
slimbus Networking changes for 6.19. 2025-12-03 17:24:33 -08:00
soc net: ethernet: ti: netcp: Standardize knav_dma_open_channel to return NULL on error 2025-11-04 19:15:36 -08:00
soundwire soundwire updates for 6.18 2025-10-06 10:32:22 -07:00
spi spi: nxp-fspi: Propagate fwnode in ACPI case as well 2025-11-27 11:41:06 +00:00
spmi irqdomain: spmi: Switch to irq_domain_create_tree() 2025-05-21 14:53:17 +02:00
ssb treewide: rename GPIO set callbacks back to their original names 2025-08-07 10:07:06 +02:00
staging printk changes for 6.19 2025-12-03 12:42:36 -08:00
target Networking changes for 6.19. 2025-12-03 17:24:33 -08:00
tc TC: Fix the wrong format specifier 2024-11-12 15:48:08 +01:00
tee QCOMTEE fixes2 for v6.18 2025-11-21 21:27:20 +01:00
thermal Thermal control updates for 6.19-rc1 2025-12-02 17:49:12 -08:00
thunderbolt thunderbolt: Add support for Intel Wildcat Lake 2025-10-20 08:20:34 +02:00
tty printk changes for 6.19 2025-12-03 12:42:36 -08:00
ufs scsi: ufs: core: Fix invalid probe error return value 2025-10-29 23:20:19 -04:00
uio hyperv-next for v6.18 2025-10-07 08:40:15 -07:00
usb Power management updates for 6.19-rc1 2025-12-02 17:31:22 -08:00
vdpa mlx5: Fix default values in create CQ 2025-11-11 15:12:18 +01:00
vfio vfs-6.19-rc1.fd_prepare.fs 2025-12-01 17:32:07 -08:00
vhost vhost: rewind next_avail_head while discarding descriptors 2025-11-26 14:44:58 -08:00
video drm, fbcon, vga_switcheroo: Avoid race condition in fbcon setup 2025-11-25 09:08:32 +01:00
virt arm64 updates for 6.18 2025-09-29 18:48:39 -07:00
virtio virtio,vhost: fixes, cleanups 2025-10-04 08:48:16 -07:00
w1 w1: matrox: Remove some deadcode in matrox_w1_remove() 2025-08-31 14:14:07 +02:00
watchdog watchdog: diag288_wdt: Remove KMSG_COMPONENT macro 2025-11-26 17:34:52 +01:00
xen Networking changes for 6.19. 2025-12-03 17:24:33 -08:00
zorro zorro: Remove extra whitespace in macro definitions 2025-09-15 14:30:17 +02:00
Kconfig arm_mpam: Add probe/remove for mpam msc driver and kbuild boiler plate 2025-11-19 18:34:20 +00:00
Makefile arm_mpam: Add probe/remove for mpam msc driver and kbuild boiler plate 2025-11-19 18:34:20 +00:00