diff options
author | Yu Kuai <yukuai3@huawei.com> | 2023-01-03 19:28:33 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-01-16 19:04:07 -0700 |
commit | e3ff8887e7db757360f97634e0d6f4b8e27a8c46 (patch) | |
tree | bb44a98819c6460a58a1fef130b0b0f19860e027 /block | |
parent | 3e9900f3bd7ba30d60f82b162b70a1dffe4e8e24 (diff) |
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>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-cgroup.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index ce6a2b7d3dfb..4c94a6560f62 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -1455,6 +1455,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; |