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

Tycho Andersen tycho.andersen at canonical.com
Thu Apr 23 09:05:56 PDT 2015


On Thu, Apr 23, 2015 at 06:51:26PM +0300, Pavel Emelyanov wrote:
> On 04/23/2015 06:09 PM, Tycho Andersen wrote:
> > On Thu, Apr 23, 2015 at 06:04:35PM +0300, Pavel Emelyanov wrote:
> >> On 04/23/2015 05:31 PM, Tycho Andersen wrote:
> >>> On Thu, Apr 23, 2015 at 02:52:35PM +0300, Pavel Emelyanov wrote:
> >>>> On 04/23/2015 02:17 PM, Oleg Nesterov wrote:
> >>>>
> >>>>> Now what? Obviously we can't just add
> >>>>>
> >>>>> 	if (is_not_external_mount(m))
> >>>>> 		continue;
> >>>>
> >>>> Why not? The is_not_external_mount() is
> >>>>
> >>>> fsroot_mounted(m) || /* mount's root is visible from chroot */
> >>>
> >>> But what if the mount's root is /? e.g with pstore in lxc, the
> >>> mountinfo from inside looks like:
> >>>
> >>> 110 104 0:23 / /sys/fs/pstore rw,nosuid,nodev,noexec,relatime master:11 - pstore pstore rw
> >>>
> >>> which is a bind mount from the host's:
> >>>
> >>> 29 17 0:23 / /sys/fs/pstore rw,nosuid,nodev,noexec,relatime shared:11 - pstore pstore rw
> >>
> >> Ah, so sharing takes place. OK, then (sorry, maybe I'm replaying your
> >> conversation again, but I'm still blind about it) the check should be
> >>
> >>    (fsroot_mounted(m) || root_is_visible(m)) && master_is_external(m)
> > 
> > I think not, because if we didn't have this as a shared mount it would
> > still be an external bind mount, just without sharing. An external
> > master peer is an indication that it's a bind mount, but if we don't
> > have one of those, it could still be a bind mount.
> 
> Ah, sure. It should be NOT before master_is_external, like this
> 
>    (fsroot_mounted(m) || root_is_visible(m)) && !master_is_external()
> 
> Provided master_is_external() is false for private mounts, this should
> handle Oleg's case with mount --make-rprivate, but in suboptimal way --
> all mountpoints will be bind-mounted from host with MS_SLAVE flag.

But this only works for mounts that have external masters. Doesn't it
fail to exclude mounts which aren't in a peer group at all (since
!master_is_external() will always be true for them)?

Tycho

> -- Pavel


More information about the CRIU mailing list