Re: [PATCH RESEND 3/5] blk-iocost: fix incorrect lock order for rq_qos_mutex and freeze queue
From: Nilay Shroff
Date: Mon Nov 17 2025 - 05:21:16 EST
On 11/16/25 9:40 AM, Yu Kuai wrote:
> Like wbt, rq_qos_add() can be called from two path and the lock order
> are inversely:
>
> - From ioc_qos_write(), queue is already freezed before rq_qos_add();
> - From ioc_cost_model_write(), rq_qos_add() is called directly;
>
> Fix this problem by converting to use blkg_conf_open_bdev_frozen()
> from ioc_cost_model_write(), then since all rq_qos_add() callers
> already freeze queue, convert to use rq_qos_add_freezed.
>
> Signed-off-by: Yu Kuai <yukuai@xxxxxxxxx>
Looks good to me:
Reviewed-by: Nilay Shroff <nilay@xxxxxxxxxxxxx>