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

Tycho Andersen tycho.andersen at canonical.com
Wed Apr 22 10:00:20 PDT 2015


On Wed, Apr 22, 2015 at 06:48:17PM +0200, Oleg Nesterov wrote:
> Tycho,
> 
> Thanks for your answers. I feel I should not waste your time until I
> try to read the docs and the code, but let me ask another question
> right now.
> 
> On 04/22, Tycho Andersen wrote:
> >
> > On Wed, Apr 22, 2015 at 9:35 AM, Oleg Nesterov <oleg at redhat.com> wrote:
> > >
> > > OK, before I dive into the sources, could you please tell me what
> > > should I pass as KEY:VAL pair? (I didn't read this code yet and I
> > > am not sure if I can understand it, at least quickly).
> >
> > Looking at your mountinfo, I'm not sure you can dump this process. The
> > problem is e.g.:
> >
> > 36 34 253:1 / / rw,relatime shared:7 master:1 - xfs
> > /dev/mapper/rhel_ibm--x3650m4--02--vm--02-root
> > rw,seclabel,attr2,inode64,noquota
> >
> > This is not a bind mount, but it has external sharing according to the
> > rest of your mountinfo (there is no "shared:1" anywhere). There is no
> > way to tell criu (currently) to allow mounts that aren't bind mounts
> > to have sharing.
> 
> Hmm. But it fails because it can't dump the _bind_ mount?
> 
> > I guess this configuration is the result of something
> > like:
> >
> > unshare(CLONE_NEWNS)
> > mount(NULL, "/", NULL, MS_PRIVATE, NULL)
> 
> MS_SLAVE + MS_SHARED according to strace...

Urh, sorry, yes. That's what I meant by MS_PRIVATE ;)

> 
> > so all criu needs to do is learn how to do that and it should be ok.
> 
> Let me start from the very beginning.
> 
> 	# unshare -m
> 	# perl -e 'close STDIN; close STDOUT; close STDERR; sleep'
> 
> dump/restore from the root ns works.
> 
> 	# unshare -m
> 	# mount --make-slave /
> 	# mount --make-shared /
> 	# perl -e 'close STDIN; close STDOUT; close STDERR; sleep'
> 	
> dump/restore still work

I'm confused about why this works, it seems like you have external
masters in this case too. Can you post the mountinfo? When I do it I
get:

152 151 253:1 / / rw,relatime shared:31 master:1 - ext4 /dev/disk/by-uuid/6c5a78e0-95fa-49a8-aa91-a8093d295e58 rw,data=ordered

where the peer group 1 is the rootfs mount on root namespace.

> 	# unshare -m
> 	# mount --make-slave /
> 	# mount --make-shared /
> 	# mkdir /tmp/A /tmp/B
> 	# mount --bind /tmp/A /tmp/B
> 	# perl -e 'close STDIN; close STDOUT; close STDERR; sleep' 
> 
> Now it fails with the same
> 
> 	Mount 35 ./tmp/B (master_id: 1 shared_id: 7) has unreachable sharing.
> 
> error message.
> 
> Why "restore" can't dump it? "restore" could simply do MS_BIND?

Sorry, I'm not sure what you mean by "restore" here? Anyway, yes, it
could do MS_BIND with some sharing flags, I think we just haven't
implemented that yet (this isn't an external mount, since it's bound
within the namespace).

Tycho

> Oleg.
> 


More information about the CRIU mailing list