[lxc-devel] [PATCH] pivot_root: umount ., not /

Serge Hallyn serge.hallyn at ubuntu.com
Mon Sep 29 22:51:35 UTC 2014


This fixes pivot_root on 3.11 and older kernels.

Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
---
 src/lxc/conf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 31673d5..e8979c9 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -1062,7 +1062,7 @@ static int setup_rootfs_pivot_root(const char *rootfs, const char *pivotdir)
 		SYSERROR("Error entering oldroot");
 		goto fail;
 	}
-	if (umount2("/", MNT_DETACH) < 0) {
+	if (umount2(".", MNT_DETACH) < 0) {
 		SYSERROR("Error detaching old root");
 		goto fail;
 	}
-- 
2.1.0



More information about the lxc-devel mailing list