[Lxc-users] lxc-start fails when / is a shared mount

Serge E. Hallyn serge.hallyn at canonical.com
Mon Sep 19 16:38:27 UTC 2011


It'd be worth asking Ram about that.  It's possible he was being overly
cautious as this was new ground, but it seems likely there was a good
reason for it.

Heck, rather than guessing,  cc:ing Ram.  Ram, can you explain the need
for all three parts of that check at pivot_root():

+       if (IS_MNT_SHARED(old_nd.mnt) ||
+               IS_MNT_SHARED(new_nd.mnt->mnt_parent) ||
+               IS_MNT_SHARED(user_nd.mnt->mnt_parent))

?

thanks,
-serge

Quoting Marios Titas (redneb8888 at gmail.com):
> It seems that the kernel commit
> 2144440327fa01b2f3f65e355120a78211685702 from 2005 is the culprit.
> It's the commit that implemented mount --move in presense of shared
> mounts. It added a check in fs/namespace.c that makes pivot_root fail
> when the old root is marked as a shared mount. I don't understand the
> reason for that.
> 
> 
> On Mon, Sep 19, 2011 at 09:35, Serge Hallyn <serge.hallyn at canonical.com> wrote:
> > Quoting Marios Titas (redneb8888 at gmail.com):
> >> Hi list,
> >>
> >> I just ran into this problem: If you do
> >>     # mount --make-shared /
> >> to mark / as a shared mount then lxc-start fails when you have
> >> specified a lxc.rootfs in the configuration file. The error that
> >> lxc-start gives is the following:
> >>     Invalid argument - pivot_root syscall failed
> >> Is this the normal behavior or is this a kernel bug?
> >
> > It is normal behavior.  Perhaps lxc should fall back to chroot when
> > pivot_root fails.
> >
> > -serge
> >




More information about the lxc-users mailing list