]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
blk-wbt: fix possible deadlock to nest pcpu_alloc_mutex under q_usage_counter
authorYu Kuai <yukuai@fnnas.com>
Mon, 2 Feb 2026 08:05:17 +0000 (16:05 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 2 Feb 2026 14:05:19 +0000 (07:05 -0700)
commit41afaeeda5099d9cd07eaa7dc6c3d20c6f1dd9e9
tree701c022d8b25a556e47778c11e1de0effed3605d
parent2751b90051a0211ed7c78f26eb2a9b7038804b9b
blk-wbt: fix possible deadlock to nest pcpu_alloc_mutex under q_usage_counter

If wbt is disabled by default and user configures wbt by sysfs, queue
will be frozen first and then pcpu_alloc_mutex will be held in
blk_stat_alloc_callback().

Fix this problem by allocating memory first before queue frozen.

Signed-off-by: Yu Kuai <yukuai@fnnas.com>
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-wbt.c