[lxc-users] [PATCH] check whether rootfs is shared before running pre-mount hooks

Serge Hallyn serge.hallyn at ubuntu.com
Thu Mar 27 14:24:19 UTC 2014


Quoting Florian Klink (flokli at flokli.de):
> this expands c597baa8f9 and 2c6f3fc932.
> ---

Thanks, this looks right.  Two things though:

1. The whole block from lines 1509,1519 should probably be moved to
there instead.  Mind you the detect_ramfs_rootfs() does not apparently
do the right thing, but one day it might :)

2. we do need a signed-off-by to take your patch

>  src/lxc/conf.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/src/lxc/conf.c b/src/lxc/conf.c
> index a9d64ba..4212ded 100644
> --- a/src/lxc/conf.c
> +++ b/src/lxc/conf.c
> @@ -3707,6 +3707,13 @@ void tmp_proc_unmount(struct lxc_conf *lxc_conf)
>  
>  int lxc_setup(struct lxc_handler *handler)
>  {
> +	if (detect_shared_rootfs()) {
> +		if (mount(NULL, "/", NULL, MS_SLAVE|MS_REC, NULL)) {
> +			SYSERROR("Failed to make / rslave");
> +			ERROR("Continuing...");
> +		}
> +	}
> +
>  	const char *name = handler->name;
>  	struct lxc_conf *lxc_conf = handler->conf;
>  	const char *lxcpath = handler->lxcpath;
> -- 
> 1.9.1
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users


More information about the lxc-users mailing list