Re: [PATCH 2/2] blk-ioprio: remove per-disk structure

From: Yu Kuai
Date: Fri Jul 12 2024 - 02:52:10 EST


Hi,

在 2024/07/12 13:22, Christoph Hellwig 写道:
On Fri, Jul 12, 2024 at 09:10:30AM +0800, Yu Kuai wrote:
As one can see in the output of git grep -nHEB1 '>pd_(alloc|free)_fn\(',
none of the pd_alloc_fn / pd_free_fn callers checks whether or not these
pointers are NULL. Hence my question why this patch does not trigger any
NULL pointer dereferences?

Because the blkcg_deactivate_policy() is removed as well, there are no
callers now... blkcg_policy_register() is still called to make sure
cpd_(alloc|free)_fn will still be called.

Can you throw in a patch documenting this? Any maybe add a check
that pd_alloc_fn / pd_free_fn exist in blkcg_activate_policy and
WARN and return an error otherwise?

Of course, I realized now that just mention don't activate the policy
from commit message is too little explanation.

Thanks,
Kuai


.