[CRIU] [PATCH v2 3/3] mount: handle tracefs more gracefully
Tycho Andersen
tycho.andersen at canonical.com
Fri May 13 07:36:09 PDT 2016
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.
Tycho
More information about the CRIU
mailing list