[libvirt] [RFC v2 0/4] LXC with block device and enabled userns

Radostin Stoyanov rstoyanov1 at gmail.com
Sun Jun 10 11:14:22 UTC 2018


Hi all,

This patch series aims to resolve
https://bugzilla.redhat.com/show_bug.cgi?id=1328946

For background information about the issue see v1 of this RFC.
https://www.redhat.com/archives/libvir-list/2018-April/msg01270.html

The current state of this series enables the start of LXC container with NBD
file system and enabled user namespace.

However, container shutdown causes "kernel BUG at fs/buffer.c:3058!"
https://pastebin.com/raw/y0ycSM0H

The reason for this is because qemu-nbd process is terminated/killed without
unmounting the container root file system.

This issue has been reported in [1] and [2].
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1356110
[2] http://lkml.iu.edu/hypermail/linux/kernel/1509.3/00027.html

As a workaround we could unmount the root file system of container before shutdown.

For example with:
    $ CT_PID=$(pidof libvirt_lxc)
    $ sudo nsenter \
        --mount=/proc/$CT_PID/task/$CT_PID/ns/mnt \
        /bin/bash -c "umount /var/run/libvirt/lxc/guest.root/"

I noticed that we already have the functions lxcContainerUnmountSubtree
and virProcessRunInMountNamespace.

Any suggestions on how to properly implement this?

Thanks,

Radostin Stoyanov (4):
  lxc: Make lxcContainerMountFSBlock non static
  lxc: Move up virLXCControllerAppendNBDPids
  lxc: Mount NBD devices before clone
  lxc: Remove unused lxcContainerPrepareRoot

 src/lxc/lxc_container.c  |  58 +-------------
 src/lxc/lxc_container.h  |   4 +
 src/lxc/lxc_controller.c | 158 +++++++++++++++++++++++----------------
 3 files changed, 97 insertions(+), 123 deletions(-)

--
2.17.1




More information about the libvir-list mailing list