From: Tejun Heo Date: Thu, 13 Jun 2019 22:30:40 +0000 (-0700) Subject: blkcg: blkcg_activate_policy() should initialize ancestors first X-Git-Tag: v5.4-rc1~640^2~109 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=71c814077de60b2e7415dac6f5c4e98f59d521fd;p=platform%2Fkernel%2Flinux-rpi.git blkcg: blkcg_activate_policy() should initialize ancestors first When blkcg_activate_policy() is creating blkg_policy_data for existing blkgs, it did in the wrong order - descendants first. Fix it. None of the existing controllers seem affected by this. Signed-off-by: Tejun Heo Signed-off-by: Jens Axboe --- diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 04d2869..4407972 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -1390,7 +1390,8 @@ pd_prealloc: 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])