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

Tycho Andersen tycho.andersen at canonical.com
Wed May 11 07:49:19 PDT 2016


On Wed, May 11, 2016 at 03:49:07PM +0300, Pavel Emelyanov wrote:
> 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?

Yes, this sounds a lot better :). I'll resend, thanks for the
suggestion.

Tycho

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


More information about the CRIU mailing list