[lxc-devel] [cgmanager/master] Don't mount /run/cgmanager/fs tmpfs until after unshare

hallyn on Github lxc-bot at linuxcontainers.org
Tue Mar 1 01:11:31 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 395 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160301/35e0e3ad/attachment.bin>
-------------- next part --------------
From 697a2f83a65e17c700f0d8ef53f6766de196fdc1 Mon Sep 17 00:00:00 2001
From: Serge Hallyn <serge.hallyn at ubuntu.com>
Date: Mon, 29 Feb 2016 16:57:29 -0800
Subject: [PATCH] Don't mount /run/cgmanager/fs tmpfs until after unshare

So we don't litter after we stop.

Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
---
 fs.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/fs.c b/fs.c
index 4e5847c..1366cfd 100644
--- a/fs.c
+++ b/fs.c
@@ -143,10 +143,6 @@ bool setup_base_run_path(void)
 		nih_fatal("%s: failed to create /run/cgmanager/fs", __func__);
 		return false;
 	}
-	if (mount("cgmfs", "/run/cgmanager/fs", "tmpfs", 0, "size=100000,mode=0755") < 0) {
-		nih_fatal("%s: failed to mount tmpfs onto /run/cgmanager/fs", __func__);
-		return false;
-	}
 	if (mkdir(AGENT_LINK_PATH, 0755) < 0 && errno != EEXIST) {
 		nih_fatal("%s: failed to create %s", __func__, AGENT_LINK_PATH);
 		return false;
@@ -1246,6 +1242,11 @@ int setup_cgroup_mounts(void)
 		return -1;
 	}
 
+	if (mount("cgmfs", "/run/cgmanager/fs", "tmpfs", 0, "size=100000,mode=0755") < 0) {
+		nih_fatal("%s: failed to mount tmpfs onto /run/cgmanager/fs", __func__);
+		return false;
+	}
+
 	if (!do_mount_unified())
 		return -1;
 


More information about the lxc-devel mailing list