From b6e07af7c255f3650edc8ce3f83b6af7e5c02f66 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Mart=C3=ADnez?= Date: Sun, 6 Jul 2014 21:55:41 +0200 Subject: [PATCH] lxc-ubuntu: fix btrfs when rootfs == realrootfs MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix btrfs support when lxc-create does not bind-mount the rootfs. Signed-off-by: José Martínez Acked-by: Stéphane Graber --- templates/lxc-ubuntu.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/lxc-ubuntu.in b/templates/lxc-ubuntu.in index 8550ce920..b151375a1 100644 --- a/templates/lxc-ubuntu.in +++ b/templates/lxc-ubuntu.in @@ -404,10 +404,10 @@ copy_ubuntu() try_mksubvolume $rootfs if is_btrfs_subvolume $cache/rootfs-$arch && is_btrfs_subvolume $rootfs; then realrootfs=$(dirname $config)/rootfs - umount $rootfs || return 1 + [ "$rootfs" = "$realrootfs" ] || umount $rootfs || return 1 btrfs subvolume delete $realrootfs || return 1 btrfs subvolume snapshot $cache/rootfs-$arch $realrootfs || return 1 - mount --bind $realrootfs $rootfs || return 1 + [ "$rootfs" = "$realrootfs" ] || mount --bind $realrootfs $rootfs || return 1 else rsync -Ha $cache/rootfs-$arch/ $rootfs/ || return 1 fi -- 2.47.3