[lxc-devel] [lxc/lxc] e995d7: lxc startup: manually mark every shared mount entr...

GitHub noreply at github.com
Mon Apr 28 15:22:36 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: e995d7a269b3f158055e94a5f043211cd81a6966
      https://github.com/lxc/lxc/commit/e995d7a269b3f158055e94a5f043211cd81a6966
  Author: Serge Hallyn <serge.hallyn at ubuntu.com>
  Date:   2014-04-28 (Mon, 28 Apr 2014)

  Changed paths:
    M src/lxc/conf.c

  Log Message:
  -----------
  lxc startup: manually mark every shared mount entry as slave

If you 'ip netns add x1', this creates /run/netns and /run/netns/x1
as shared mounts.  When a container starts, it umounts these after
pivot_root, and the umount is propagated to the host.

Worse, doing mount("", "/", NULL, MS_SLAVE|MS_REC, NULL) does not
suffice to change those, even after binding /proc/mounts onto
/etc/mtab.

So, I give up.  Do this manually, walking over /proc/self/mountinfo
and changing the mount propagation on everything marked as shared.

With this patch, lxc-start no longer unmounts /run/netns/* on the
host.

Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>


  Commit: 276a086264a0fc1703128578d38c0574127a1c2f
      https://github.com/lxc/lxc/commit/276a086264a0fc1703128578d38c0574127a1c2f
  Author: Serge Hallyn <serge.hallyn at ubuntu.com>
  Date:   2014-04-28 (Mon, 28 Apr 2014)

  Changed paths:
    M src/lxc/lxccontainer.c
    M src/lxc/lxccontainer.h

  Log Message:
  -----------
  snapshots: move snapshot directory

Originally we kept snapshots under /var/lib/lxcsnaps.  If a
separate btrfs is mounted at /var/lib/lxc, then we can't
make btrfs snapshots under /var/lib/lxcsnaps.

This patch moves the default directory to /var/lib/lxc/lxcsnaps.
If /var/lib/lxcsnaps already exists, then use that.  Don't allow
any container to be used with the name 'lxcsnaps'.

Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>


  Commit: 09227be2868d5d4e73dace2e286ce36d7c51cb01
      https://github.com/lxc/lxc/commit/09227be2868d5d4e73dace2e286ce36d7c51cb01
  Author: Michael H. Warfield <mhw at WittsEnd.com>
  Date:   2014-04-28 (Mon, 28 Apr 2014)

  Changed paths:
    M src/lxc/conf.c

  Log Message:
  -----------
  Check for symlinks before attempting create.

Check for symlinks before attempting create.

When attempting to create the compulsory symlinks in /dev,
check for the existence of the link using stat first before
blindly attempting to create the link.

This works around an apparent quirk in the kernel VFS on read-only
file systems where the returned error code might be EEXIST or EROFS
depending on previous access to the /dev directory and its entries.

Reported-by: William Dauchy <william at gandi.net>
Signed-off-by: Michael H. Warfield <mhw at WittsEnd.com>
Tested-by: William Dauchy <william at gandi.net>


Compare: https://github.com/lxc/lxc/compare/0e98b3bd319e...09227be2868d


More information about the lxc-devel mailing list