Skip to content

Commit e3ff888

Browse files
YuKuai-huaweiaxboe
authored andcommitted
blk-cgroup: fix missing pd_online_fn() while activating policy
If the policy defines pd_online_fn(), it should be called after pd_init_fn(), like blkg_create(). Signed-off-by: Yu Kuai <yukuai3@huawei.com> Acked-by: Tejun Heo <tj@kernel.org> Link: https://lore.kernel.org/r/20230103112833.2013432-1-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 3e9900f commit e3ff888

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

block/blk-cgroup.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,6 +1455,10 @@ int blkcg_activate_policy(struct request_queue *q,
14551455
list_for_each_entry_reverse(blkg, &q->blkg_list, q_node)
14561456
pol->pd_init_fn(blkg->pd[pol->plid]);
14571457

1458+
if (pol->pd_online_fn)
1459+
list_for_each_entry_reverse(blkg, &q->blkg_list, q_node)
1460+
pol->pd_online_fn(blkg->pd[pol->plid]);
1461+
14581462
__set_bit(pol->plid, q->blkcg_pols);
14591463
ret = 0;
14601464

0 commit comments

Comments
 (0)