提交 fddfb02a 编写于 作者: L Li Zhong 提交者: Tejun Heo

cgroup: move list add after list head initilization

2243076a ("cgroup: initialize cgrp->allcg_node in
init_cgroup_housekeeping()") initializes cgrp->allcg_node in
init_cgroup_housekeeping().  Then in init_cgroup_root(), we should
call init_cgroup_housekeeping() before adding it to &root->allcg_list;
otherwise, we are initializing an entry already in a list.
Signed-off-by: NLi Zhong <zhong@linux.vnet.ibm.com>
Signed-off-by: NTejun Heo <tj@kernel.org>
上级 811d8d6f
...@@ -1401,8 +1401,8 @@ static void init_cgroup_root(struct cgroupfs_root *root) ...@@ -1401,8 +1401,8 @@ static void init_cgroup_root(struct cgroupfs_root *root)
root->number_of_cgroups = 1; root->number_of_cgroups = 1;
cgrp->root = root; cgrp->root = root;
cgrp->top_cgroup = cgrp; cgrp->top_cgroup = cgrp;
list_add_tail(&cgrp->allcg_node, &root->allcg_list);
init_cgroup_housekeeping(cgrp); init_cgroup_housekeeping(cgrp);
list_add_tail(&cgrp->allcg_node, &root->allcg_list);
} }
static bool init_root_id(struct cgroupfs_root *root) static bool init_root_id(struct cgroupfs_root *root)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册