Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 71c81407 authored by Tejun Heo's avatar Tejun Heo Committed by Jens Axboe
Browse files

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: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent ef069b97
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1390,7 +1390,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])