File 0001-Ensure-btrfs-subvolume-is-destroyed-on-error.patch of Package lxc
From 028d1b3eb110229113dc99f3587fac1f9fca9b0e Mon Sep 17 00:00:00 2001
From: Frederic Crozat <fcrozat@suse.com>
Date: Wed, 14 Nov 2012 16:02:37 +0100
Subject: [PATCH] Ensure btrfs subvolume is destroyed on error
---
src/lxc/lxc-create.in | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/lxc/lxc-create.in b/src/lxc/lxc-create.in
index b21cdc3..124ffd5 100644
--- a/src/lxc/lxc-create.in
+++ b/src/lxc/lxc-create.in
@@ -237,6 +237,8 @@ cleanup() {
if [ $backingstore = "lvm" ]; then
umount $rootfs
lvremove -f $rootdev
+ elif [ $backingstore = "btrfs" ]; then
+ btrfs subvolume delete "$rootfs"
fi
${bindir}/lxc-destroy -n $lxc_name
echo "$(basename $0): aborted" >&2
--
1.7.10.4