• Andrey Vagin's avatar
    mntns: simplify a case, when a root should be changed · a2fd8cd0
    Andrey Vagin authored
    We don't need to clean_mnt_ns(), if we are goning to do pivot_root().
    
    """
    pivot_root moves the root file system of the current process to the
    directory put_old and makes new_root the new root file system.
    """
    
    So I suggest to do pivot_root() and then detach the old root, all
    other mount points will be unmounted automatically.
    
    This patch fixes a problem, when a new root is mounted above a non-root
    mount point. It's a default configuration for OpenVZ.
    Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
    a2fd8cd0
mount.c 14.3 KB