Преглед на файлове

lxc: fix lxc-destroy

Signed-off-by: Luka Perkov <luka@openwrt.org>
Luka Perkov преди 10 години
родител
ревизия
2c52da0cf2
променени са 1 файла, в които са добавени 48 реда и са изтрити 0 реда
  1. 48
    0
      utils/lxc/patches/300-fix-lxc-destroy.patch

+ 48
- 0
utils/lxc/patches/300-fix-lxc-destroy.patch Целия файл

@@ -0,0 +1,48 @@
1
+From bdeafb7bc4857e80dbca5192a751eedcf7b69abd Mon Sep 17 00:00:00 2001
2
+From: Luka Perkov <luka@openwrt.org>
3
+Date: Mon, 27 Oct 2014 21:49:46 +0100
4
+Subject: [PATCH] utils: remove unnecessary check of mystat.st_dev
5
+
6
+The check is not needed and it breaks lxc-destroy when container is installed
7
+on top of overlayfs. More information why this is a problem on overlayfs can be
8
+found here:
9
+
10
+https://kernel.googlesource.com/pub/scm/linux/kernel/git/mszeredi/vfs/+/overlayfs.current/Documentation/filesystems/overlayfs.txt
11
+
12
+Signed-off-by: Luka Perkov <luka@openwrt.org>
13
+---
14
+ src/lxc/utils.c | 10 ++++------
15
+ 1 file changed, 4 insertions(+), 6 deletions(-)
16
+
17
+--- a/src/lxc/utils.c
18
++++ b/src/lxc/utils.c
19
+@@ -46,7 +46,7 @@
20
+ 
21
+ lxc_log_define(lxc_utils, lxc);
22
+ 
23
+-static int _recursive_rmdir_onedev(char *dirname, dev_t pdev)
24
++static int _recursive_rmdir_onedev(char *dirname)
25
+ {
26
+ 	struct dirent dirent, *direntp;
27
+ 	DIR *dir;
28
+@@ -82,10 +82,8 @@ static int _recursive_rmdir_onedev(char
29
+ 			failed=1;
30
+ 			continue;
31
+ 		}
32
+-		if (mystat.st_dev != pdev)
33
+-			continue;
34
+ 		if (S_ISDIR(mystat.st_mode)) {
35
+-			if (_recursive_rmdir_onedev(pathname, pdev) < 0)
36
++			if (_recursive_rmdir_onedev(pathname) < 0)
37
+ 				failed=1;
38
+ 		} else {
39
+ 			if (unlink(pathname) < 0) {
40
+@@ -119,7 +117,7 @@ extern int lxc_rmdir_onedev(char *path)
41
+ 		return -1;
42
+ 	}
43
+ 
44
+-	return _recursive_rmdir_onedev(path, mystat.st_dev);
45
++	return _recursive_rmdir_onedev(path);
46
+ }
47
+ 
48
+ static int mount_fs(const char *source, const char *target, const char *type)