Skip to content

Commit 847d9fb

Browse files
committed
Merge branch 'for-4.14-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
Pull cgroup fix from Tejun Heo: "The recent migration code updates assumed that migrations always execute from the top to the bottom once and didn't clean up internal states after each migration round; however, cgroup_transfer_tasks() repeats the inner steps multiple times and the garbage internal states from the previous iteration led to OOPS. Waiman fixed the bug by reinitializing the relevant states at the end of each migration round" * 'for-4.14-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cgroup: Reinit cgroup_taskset structure before cgroup_migrate_execute() returns
2 parents ff93026 + c4fa6c4 commit 847d9fb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

kernel/cgroup/cgroup.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2311,6 +2311,14 @@ static int cgroup_migrate_execute(struct cgroup_mgctx *mgctx)
23112311
list_del_init(&cset->mg_node);
23122312
}
23132313
spin_unlock_irq(&css_set_lock);
2314+
2315+
/*
2316+
* Re-initialize the cgroup_taskset structure in case it is reused
2317+
* again in another cgroup_migrate_add_task()/cgroup_migrate_execute()
2318+
* iteration.
2319+
*/
2320+
tset->nr_tasks = 0;
2321+
tset->csets = &tset->src_csets;
23142322
return ret;
23152323
}
23162324

0 commit comments

Comments
 (0)