diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index d5ec7f9b460df26b87360d2e64ec6a33e4149d7f..f89bd84a180f01609ecff5e27e91c2f2ce41a5d9 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -1443,7 +1443,8 @@ int blkcg_activate_policy(struct request_queue *q, spin_lock_irq(q->queue_lock); - list_for_each_entry(blkg, &q->blkg_list, q_node) { + /* blkg_list is pushed at the head, reverse walk to init parents first */ + list_for_each_entry_reverse(blkg, &q->blkg_list, q_node) { struct blkg_policy_data *pd; if (blkg->pd[pol->plid])