[PATCH linux-next]cgroup: move list add after list head initilization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



commit 2243076ad128d0cc196cf6597e6ddcf6bc907676 initialize
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: Li Zhong <zhong@xxxxxxxxxxxxxxxxxx>
---
 kernel/cgroup.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 01d5342..35133cf 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1400,8 +1400,8 @@ static void init_cgroup_root(struct cgroupfs_root *root)
 	root->number_of_cgroups = 1;
 	cgrp->root = root;
 	cgrp->top_cgroup = cgrp;
-	list_add_tail(&cgrp->allcg_node, &root->allcg_list);
 	init_cgroup_housekeeping(cgrp);
+	list_add_tail(&cgrp->allcg_node, &root->allcg_list);
 }
 
 static bool init_root_id(struct cgroupfs_root *root)
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-next" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux USB Development]     [Yosemite News]     [Linux SCSI]

  Powered by Linux