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

Tycho Andersen tycho.andersen at canonical.com
Fri May 13 10:32:40 PDT 2016


On Fri, May 13, 2016 at 08:32:18PM +0300, Pavel Emelyanov wrote:
> On 05/13/2016 05:36 PM, Tycho Andersen wrote:
> > On Fri, May 13, 2016 at 02:31:09PM +0300, Pavel Emelyanov wrote:
> >> On 05/12/2016 09:43 PM, Tycho Andersen wrote:
> >>> On Thu, May 12, 2016 at 09:34:10PM +0300, Pavel Emelyanov wrote:
> >>>> On 05/12/2016 06:39 PM, Tycho Andersen wrote:
> >>>>> On Thu, May 12, 2016 at 05:22:18PM +0300, Pavel Emelyanov wrote:
> >>>>>>> +		if (new->fstype->code == FSTYPE__TRACEFS) {
> >>>>>>> +			pr_info("\tskipping tracefs mounted at %s\n", new->mountpoint + 1);
> >>>>>>> +			mnt_entry_free(new);
> >>>>>>> +			new = NULL;
> >>>>>>> +			goto end;
> >>>>>>> +		}
> >>>>>>> +
> >>>>>>>  		pr_info("\ttype %s source %s mnt_id %d s_dev %#x %s @ %s flags %#x options %s\n",
> >>>>>>>  				fsname, new->source,
> >>>>>>>  				new->mnt_id, new->s_dev, new->root, new->mountpoint,
> >>>>>>
> >>>>>> Why do we need to drop this entry? AFAIU this is only required to make
> >>>>>> restore skip mounting one and let 'mount -t debugfs' do the thing, right?
> >>>>>> If yes, then we should keep this entry parsed and skip one on restore.
> >>>>>> I would say -- the debugfs' -> parse callback should walk all tracefs'
> >>>>>> MI's and set mounted on them to true.
> >>>>>
> >>>>> Hmm, actually I'm a little confused about this. Do you mean ->mount
> >>>>> here?
> >>>>
> >>>> Yup. I wrote ->parse by mistake :(
> >>>
> >>> The problem here is still that it's a bind mount for us, so debugfs'
> >>
> >> External bind mount? Is it specified as such with --ext-mount-map?
> > 
> > With --ext-mount-map auto it gets detected as such.
> > 
> >>> ->mount never gets called :(
> >>
> >> How about fixing the tracefs's mi in ->parse callback making it debugfs? :)
> > 
> > I don't think that would work either, we'd still end up bind mounting
> > it and hitting the kernel's overmounting checks.
> > 
> > What we could do is in debugfs' ->parse to add MS_REC always. We'd
> > still need this hunk (although I think it needs to drop the MS_PROPAGATE flags
> > in looking at it), but some other extra bits would go away.
> > 
> > @@ -2474,12 +2488,16 @@ do_bind:
> >                 }
> >         }
> > 
> > -       if (mount(root, mi->mountpoint, NULL, MS_BIND, NULL) < 0) {
> > +       if (mount(root, mi->mountpoint, NULL, MS_BIND | mi->fstype->flags, NULL) < 0) {
> >                 pr_perror("Can't mount at %s", mi->mountpoint);
> >                 goto err;
> >         }
> > 
> > 
> > but we could get rid of the other hungs and fstype->flags all together. That
> > doesn't solve our tracefs problem, but it does make the patch smaller.
> 
> Hm.. OK, let's do whatever is required, but try to avoid checks for exact
> fstype name/code in generic code.

Ok, I'll try and think of a way to get rid of the FSTYPE__TRACEFS
check over the weekend, and if I can't come up with anything, I'll
send out an updated set without ->flags on Monday.

Thanks!

Tycho


More information about the CRIU mailing list