From: Yu Kuai Date: Tue, 3 Jan 2023 11:28:33 +0000 (+0800) Subject: blk-cgroup: fix missing pd_online_fn() while activating policy X-Git-Tag: baikal/aarch64/sdk5.9~24 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=58bbc0edb4237ec06a82681adc6a78dc94eaa04d;p=kernel.git blk-cgroup: fix missing pd_online_fn() while activating policy [ Upstream commit e3ff8887e7db757360f97634e0d6f4b8e27a8c46 ] If the policy defines pd_online_fn(), it should be called after pd_init_fn(), like blkg_create(). Signed-off-by: Yu Kuai Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20230103112833.2013432-1-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index dde8d0acfb34f..cd085a0e5e4a7 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -1445,6 +1445,10 @@ retry: list_for_each_entry_reverse(blkg, &q->blkg_list, q_node) pol->pd_init_fn(blkg->pd[pol->plid]); + if (pol->pd_online_fn) + list_for_each_entry_reverse(blkg, &q->blkg_list, q_node) + pol->pd_online_fn(blkg->pd[pol->plid]); + __set_bit(pol->plid, q->blkcg_pols); ret = 0;