The lxc_setup-routine in conf.c tries to configure the filesystem namespace for a new container by first recursively bind-mounting the directory which is supposed to become the root filesystem of the container to the 'rootfs mount point' and then adding whatever other mounts have been requested in the configuration file being used to the original filesystem location of the nascent container root filesystem. At least for Linux 2.6.35.7 (and .4), this doesn't work because the MS_REC flag only affects submounts which already existed at the time of the bind mount, not new ones which come into existence afterwards. The patch moves the setup_rootfs call in lxc_setup behind the two 'setup additional mounts' calls which fixes this problem (at least for me).
Signed-off-by: Rainer Weikusat ([email protected]) --- diff -pur lxc/src/lxc/conf.c lxc.patched/src/lxc/conf.c --- lxc/src/lxc/conf.c 2010-11-04 18:10:08.000000000 +0100 +++ lxc.patched/src/lxc/conf.c 2010-11-04 18:32:24.000000000 +0100 @@ -1597,11 +1597,6 @@ int lxc_setup(const char *name, struct l return -1; } - if (setup_rootfs(&lxc_conf->rootfs)) { - ERROR("failed to setup rootfs for '%s'", name); - return -1; - } - if (setup_mount(lxc_conf->fstab)) { ERROR("failed to setup the mounts for '%s'", name); return -1; @@ -1611,6 +1606,11 @@ int lxc_setup(const char *name, struct l ERROR("failed to setup the mount entries for '%s'", name); return -1; } + + if (setup_rootfs(&lxc_conf->rootfs)) { + ERROR("failed to setup rootfs for '%s'", name); + return -1; + } if (setup_cgroup(name, &lxc_conf->cgroup)) { ERROR("failed to setup the cgroups for '%s'", name); ------------------------------------------------------------------------------ The Next 800 Companies to Lead America's Growth: New Video Whitepaper David G. Thomson, author of the best-selling book "Blueprint to a Billion" shares his insights and actions to help propel your business during the next growth cycle. Listen Now! http://p.sf.net/sfu/SAP-dev2dev _______________________________________________ Lxc-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/lxc-devel
