diff options
| author | Ming Lei <ming.lei@redhat.com> | 2026-03-05 11:15:50 +0800 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2026-03-05 04:01:42 -0700 |
| commit | ce8ee8583ed83122405eabaa8fb351be4d9dc65c (patch) | |
| tree | 86439944b7169805737e33b20c125e79eed23fba /include/linux | |
| parent | d90c470b0eca9d2d77a23a1cd7d6ac7fb02d7cb8 (diff) | |
block: use trylock to avoid lockdep circular dependency in sysfs
Use trylock instead of blocking lock acquisition for update_nr_hwq_lock
in queue_requests_store() and elv_iosched_store() to avoid circular lock
dependency with kernfs active reference during concurrent disk deletion:
update_nr_hwq_lock -> kn->active (via del_gendisk -> kobject_del)
kn->active -> update_nr_hwq_lock (via sysfs write path)
Return -EBUSY when the lock is not immediately available.
Reported-and-tested-by: Yi Zhang <yi.zhang@redhat.com>
Closes: https://lore.kernel.org/linux-block/CAHj4cs-em-4acsHabMdT=jJhXkCzjnprD-aQH1OgrZo4nTnmMw@mail.gmail.com/
Fixes: 626ff4f8ebcb ("blk-mq: convert to serialize updating nr_requests with update_nr_hwq_lock")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Tested-by: Yi Zhang <yi.zhang@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
