[CRIU] [PATCH CRIU 1/4] mount: get over autodetected mounts in search for widest shared peer

Tycho Andersen tycho.andersen at canonical.com
Thu Jan 21 21:10:43 PST 2016


On Thu, Jan 21, 2016 at 06:36:04PM -0800, Andrew Vagin wrote:
> On Thu, Jan 21, 2016 at 05:55:59PM -0700, Tycho Andersen wrote:
> > On Thu, Jan 21, 2016 at 03:52:10PM -0800, Andrew Vagin wrote:
> > > On Thu, Jan 21, 2016 at 01:08:41AM +0300, Pavel Tikhomirov wrote:
> > > > 
> > > > 
> > > > On 01/20/2016 09:23 PM, Andrew Vagin wrote:
> > > > >On Wed, Jan 20, 2016 at 06:42:55PM +0300, Pavel Tikhomirov wrote:
> > > > >>now all autodetected mounts are considered to be shared - fix it
> > > > >
> > > > >I don't understand what and how you fix.
> > > > 
> > > > In collect_mnt_namespaces->resolve_external_mounts if "--ext-mount-map auto"
> > > > is set all mounts which are resolved external have set m->external->val =
> > > > "CRIU:AUTOGENERATED". Thus in dump_one_mountpoint, m->root is set to it. So
> > > > on restore in prepare_namespace->prepare_mnt_ns
> > > > ->populate_mnt_ns->validate_mounts->find_widest_shared->issubpath
> > > > for all external mounts we check issubpath("CRIU:AUTOGENERATED",
> > > > "CRIU:AUTOGENERATED") and for matched mounts check that they are equal. So
> > > > next in validate_shared validation fails for really different external
> > > > mounts. I propose to check sources for such mounts instead of roots.
> > > 
> > > It's a bad idea to rewrite m->root by CRIU:AUTOGENERATED. In this case
> > > we can't restore shared mounts properly.
> > 
> > I don't see how the two are related. It seems to me like we should be
> > rewriting m->root on restore when we find the matching mount, so that
> > subsequent checks like this don't get screwed up.
> 
> For example, we have an external mount A and create two bind-mounts of it
> 
> A
> 
> A/a -> B
> A/b -> C
> 
> All this three mounts is in one shared group, which isn't "external".
> 
> We mount tmpfs into A/a/x
> 
> When we will try to restore this tree, all three mounts will have  root
> is qual to CRIU:AUTOGENERATED.

But if they're not external, isn't it a bug that they all have
CRIU:AUTOGENERATED? The only mounts that should have
CRIU:AUTOGENERATED are mounts that cross the container's mount ns
boundary.

Tycho

> Let's look at find_widest_shared which is called for B:
> 
> find_widest_shared(B) return C (instead of A)
> 
> We fount that B and C have different set of mounts and return an error.
> 
> > 
> > Tycho


More information about the CRIU mailing list