From 2c52da0cf22dd07ba6251ee851004fe80d82ec53 Mon Sep 17 00:00:00 2001 From: Luka Perkov Date: Wed, 29 Oct 2014 03:36:56 -0400 Subject: [PATCH] lxc: fix lxc-destroy Signed-off-by: Luka Perkov --- utils/lxc/patches/300-fix-lxc-destroy.patch | 48 +++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 utils/lxc/patches/300-fix-lxc-destroy.patch diff --git a/utils/lxc/patches/300-fix-lxc-destroy.patch b/utils/lxc/patches/300-fix-lxc-destroy.patch new file mode 100644 index 000000000..2192c5f59 --- /dev/null +++ b/utils/lxc/patches/300-fix-lxc-destroy.patch @@ -0,0 +1,48 @@ +From bdeafb7bc4857e80dbca5192a751eedcf7b69abd Mon Sep 17 00:00:00 2001 +From: Luka Perkov +Date: Mon, 27 Oct 2014 21:49:46 +0100 +Subject: [PATCH] utils: remove unnecessary check of mystat.st_dev + +The check is not needed and it breaks lxc-destroy when container is installed +on top of overlayfs. More information why this is a problem on overlayfs can be +found here: + +https://kernel.googlesource.com/pub/scm/linux/kernel/git/mszeredi/vfs/+/overlayfs.current/Documentation/filesystems/overlayfs.txt + +Signed-off-by: Luka Perkov +--- + src/lxc/utils.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +--- a/src/lxc/utils.c ++++ b/src/lxc/utils.c +@@ -46,7 +46,7 @@ + + lxc_log_define(lxc_utils, lxc); + +-static int _recursive_rmdir_onedev(char *dirname, dev_t pdev) ++static int _recursive_rmdir_onedev(char *dirname) + { + struct dirent dirent, *direntp; + DIR *dir; +@@ -82,10 +82,8 @@ static int _recursive_rmdir_onedev(char + failed=1; + continue; + } +- if (mystat.st_dev != pdev) +- continue; + if (S_ISDIR(mystat.st_mode)) { +- if (_recursive_rmdir_onedev(pathname, pdev) < 0) ++ if (_recursive_rmdir_onedev(pathname) < 0) + failed=1; + } else { + if (unlink(pathname) < 0) { +@@ -119,7 +117,7 @@ extern int lxc_rmdir_onedev(char *path) + return -1; + } + +- return _recursive_rmdir_onedev(path, mystat.st_dev); ++ return _recursive_rmdir_onedev(path); + } + + static int mount_fs(const char *source, const char *target, const char *type)