[CRIU] [PATCH v2 3/3] mount: handle tracefs more gracefully

Pavel Emelyanov xemul at virtuozzo.com
Wed May 11 05:49:07 PDT 2016


On 05/11/2016 12:15 AM, Tycho Andersen wrote:
> See the comment for details, but basically tracefs is automounted by the
> kernel, so we can just mount debugfs with MS_REC and get the right result.
> 
> v2: rebase on criu-dev
> 
> Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
> ---
> This is kind of similarly ugly to to a cgroup patch I sent earlier, where
> we needed some filesystem specific code and checks in various parts of
> mount.c. I somehow can't figure out a nicer way to do this, but I am
> definitely open to suggestions.

A suggestion :)

> @@ -2301,6 +2310,11 @@ static int do_new_mount(struct mount_info *mi)
>  	if (remount_ro)
>  		sflags &= ~MS_RDONLY;
>  
> +	if (tp->flags) {
> +		pr_info("forcing flags: %d\n", tp->flags);
> +		sflags |= tp->flags;
> +	}
> +
>  	if (do_mount(mi, src, mnt_fsname(mi), sflags) < 0) {

This do_mount can call mi->fs->mount() callback. What if we define one
for debugfs that would just call do_simple_mount() with updated flags?

>  		pr_perror("Can't mount at %s", mi->mountpoint);
>  		return -1;



More information about the CRIU mailing list