diff options
| author | Ming Lei <ming.lei@redhat.com> | 2025-12-23 11:27:40 +0800 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2025-12-28 09:25:26 -0700 |
| commit | 7fc4da6a304bdcd3de14fc946dc2c19437a9cc5a (patch) | |
| tree | f854e9652ad9459f9fc9330ea331448989002016 /include/uapi/linux/watch_queue.h | |
| parent | 04bdb1a04d8a2a89df504c1e34250cd3c6e31a1c (diff) | |
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: 71f28f3136af ("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>
Diffstat (limited to 'include/uapi/linux/watch_queue.h')
0 files changed, 0 insertions, 0 deletions
