[CRIU] [PATCH 02/13] mounts: initialize root before dumping mount namespace

Pavel Emelyanov xemul at parallels.com
Wed Apr 9 04:51:49 PDT 2014


On 04/09/2014 04:13 AM, Andrey Vagin wrote:
> Currently it's initialized for the root mount namespace, but we are
> going to dump nested mount namespaces.
> 
> It's used in open_mountpoint(), which is used in dump_tmpfs() and in
> other callbacks.
> 
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
>  mount.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/mount.c b/mount.c
> index cd2fe04..a89342d 100644
> --- a/mount.c
> +++ b/mount.c
> @@ -828,6 +828,9 @@ int dump_mnt_ns(int ns_pid, int ns_id)
>  	if (img_fd < 0)
>  		return -1;
>  
> +	if (mntns_collect_root(ns_pid))

This one opens a static fd, which is not get closed.

> +		goto err;
> +
>  	pm = parse_mountinfo(ns_pid);
>  	if (!pm) {
>  		pr_err("Can't parse %d's mountinfo\n", ns_pid);
> 




More information about the CRIU mailing list