lkml.org 
[lkml]   [2014]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 2/3] cgroup: make the default root invisible when it's umounted
Before this patch (in a fresh system):

# cat /proc/$$/cgroup
# mount -t cgroup -o __DEVEL__sane_behavior xxx /cgroup
# umount /cgroup
# cat /proc/$$/cgroup
0:cpuset,cpu,cpuacct,memory,devices,freezer,net_cls,blkio,perf_event,net_prio,hugetlb:/

After this patch (in a fresh system):

# cat ...
# mount ...
# umount ...
# cat /proc/$$/cgroup
#

You won't see the default root after it's umounted.

Signed-off-by: Li Zefan <lizefan@huawei.com>
---
kernel/cgroup.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index f73fe48..dabc486 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1788,6 +1788,8 @@ static void cgroup_kill_sb(struct super_block *sb)
} else {
if (root != &cgrp_dfl_root)
percpu_ref_kill(&root->cgrp.self.refcnt);
+ else
+ cgrp_dfl_root_visible = false;
}

kernfs_kill_sb(sb);
--
1.8.0.2


\
 
 \ /
  Last update: 2014-06-03 06:41    [W:0.107 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site