Re: [PATCH -next 3/4] block/rq_qos: use a global mutex to protect rq_qos apis

From: Tejun Heo
Date: Wed Jan 04 2023 - 16:39:57 EST


On Wed, Jan 04, 2023 at 04:53:53PM +0800, Yu Kuai wrote:
> From: Yu Kuai <yukuai3@xxxxxxxxxx>
>
> This patch fix following problems:
>
> 1) rq_qos_add() and rq_qos_del() is protected, while rq_qos_exit() is
> not.

This part makes sense.

> 2) rq_qos_add() and blkcg_activate_policy() is not atomic, if
> rq_qos_exit() is done before blkcg_activate_policy(),
> null-ptr-deference can be triggered.

I'm not sure this part does. I think it'd be better to guarantee that device
destruction is blocked while these configuration operations are in progress
which can be built into blkg_conf helpers.

Thanks.

--
tejun