[CRIU] Sync TODO-s for mount.c work

Oleg Nesterov oleg at redhat.com
Tue Apr 28 10:48:52 PDT 2015


On 04/28, Pavel Emelyanov wrote:
>
> On 04/28/2015 08:09 PM, Oleg Nesterov wrote:
>
> >>>
> >>> 	# unshare -m
> >>>
> >>> 	# grep run /proc/self/mountinfo
> >>> 	52 26 0:18 / /run rw,nosuid,nodev shared:22 - tmpfs tmpfs rw,seclabel,mode=755
> >>>
> >>> 	# perl -e 'close STDIN; close STDOUT; close STDERR; sleep'
> >>>
> >>> and dump/restore works. In particular it dumps/restores /run. But
> >>> it actually restores the "copy" of this mount and this is pointless
> >>> in this particular case.
> >>
> >> Sure, but from my perspective that's because /run is not detected as a clone
> >> from some existing (host-side) mountpoint.
> >
> > Yes. Well, yes and no.

So I fas confused by "not detected" above. Because currently "restore"
doesn't even try to "clone" a mountpoint from host, see below.

> ->dump callback. This complex if
>
>         if (pm->parent && !pm->dumped && !pm->need_plugin &&
>             pm->fstype->dump && fsroot_mounted(pm)
>
> is all about it and (taking into account the previous discussion) is
> all wrong :(

Yes ;)

> > Again, I am not sure I understand you... prepare_mnt_ns() always does
> > clean_mnt_ns() of !opts.root... If root_ns_mask & CLONE_NEWNS of course.
>
> Exactly. That's because we only considered the case when mount namespace
> we dump is ... quite new as compared to the host ns. So we depopulate it
> then populate back _trying_ to resolve external dependencies. Sometimes
> this doesn't work optimal, sometimes doesn't work correct at all.

Yes, yes, this is (mostly) what I tried to say from the very beginning.

> But after all the ->restore callback is only called for _new_ mounts, not
> for external or bind.

Yes, but in this case "just MS_BIND" can't work afaics.

Oleg.



More information about the CRIU mailing list