1
From: Rainer Weikusat <rweikusat@mssgmbh.com>
2
Date: Mon, 6 Dec 2010 16:33:43 +0100
3
Subject: [PATCH] restore lxc.mount/lxc.mount.entry functionality
5
The lxc_setup-routine in conf.c tries to configure the filesystem
6
namespace for a new container by first recursively bind-mounting the
7
directory which is supposed to become the root filesystem of the
8
container to the 'rootfs mount point' and then adding whatever other
9
mounts have been requested in the configuration file being used to the
10
original filesystem location of the nascent container root
11
filesystem. At least for Linux 2.6.35.7 (and .4), this doesn't work
12
because the MS_REC flag only affects submounts which already existed
13
at the time of the bind mount, not new ones which come into existence
14
afterwards. The patch moves the setup_rootfs call in lxc_setup behind
15
the two 'setup additional mounts' calls which fixes this problem (at
18
Signed-off-by: Rainer Weikusat <rweikusat@mssgmbh.com>
19
Signed-off-by: Guido Trotter <ultrotter@debian.org>
21
src/lxc/conf.c | 10 +++++-----
22
1 files changed, 5 insertions(+), 5 deletions(-)
24
diff --git a/src/lxc/conf.c b/src/lxc/conf.c
25
index e4e4bb5..20a843c 100644
28
@@ -1597,11 +1597,6 @@ int lxc_setup(const char *name, struct lxc_conf *lxc_conf)
32
- if (setup_rootfs(&lxc_conf->rootfs)) {
33
- ERROR("failed to setup rootfs for '%s'", name);
37
if (setup_mount(lxc_conf->fstab)) {
38
ERROR("failed to setup the mounts for '%s'", name);
40
@@ -1612,6 +1607,11 @@ int lxc_setup(const char *name, struct lxc_conf *lxc_conf)
44
+ if (setup_rootfs(&lxc_conf->rootfs)) {
45
+ ERROR("failed to setup rootfs for '%s'", name);
49
if (setup_cgroup(name, &lxc_conf->cgroup)) {
50
ERROR("failed to setup the cgroups for '%s'", name);