[PATCH 3/3] cgroup: set visible flag only after we've mounted the default root
From: Li Zefan <hidden>
Date: 2014-06-03 04:06:12
Also in:
lkml
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: Li Zefan <hidden>
Date: 2014-06-03 04:06:12
Also in:
lkml
Subsystem:
the rest · Maintainer:
Linus Torvalds
This fixes the failure path, so we won't set the visible flag though the mount is failed. Signed-off-by: Li Zefan <redacted> --- kernel/cgroup.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index dabc486..0b6b44e 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c@@ -1671,7 +1671,6 @@ static struct dentry *cgroup_mount(struct file_system_type *fs_type, /* look for a matching existing root */ if (!opts.subsys_mask && !opts.none && !opts.name) { - cgrp_dfl_root_visible = true; root = &cgrp_dfl_root; cgroup_get(&root->cgrp); ret = 0;
@@ -1770,6 +1769,9 @@ out_free: dentry = kernfs_mount(fs_type, flags, root->kf_root, &new_sb); if (IS_ERR(dentry) || !new_sb) cgroup_put(&root->cgrp); + else if (root == &cgrp_dfl_root) + cgrp_dfl_root_visible = true; + return dentry; }
--
1.8.0.2