You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.6 KiB

  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. The check is not needed and it breaks lxc-destroy when container is installed
  6. on top of overlayfs. More information why this is a problem on overlayfs can be
  7. found here:
  8. https://kernel.googlesource.com/pub/scm/linux/kernel/git/mszeredi/vfs/+/overlayfs.current/Documentation/filesystems/overlayfs.txt
  9. Signed-off-by: Luka Perkov <luka@openwrt.org>
  10. ---
  11. src/lxc/utils.c | 10 ++++------
  12. 1 file changed, 4 insertions(+), 6 deletions(-)
  13. --- a/src/lxc/utils.c
  14. +++ b/src/lxc/utils.c
  15. @@ -47,7 +47,7 @@
  16. lxc_log_define(lxc_utils, lxc);
  17. -static int _recursive_rmdir_onedev(char *dirname, dev_t pdev,
  18. +static int _recursive_rmdir_onedev(char *dirname,
  19. const char *exclude, int level)
  20. {
  21. struct dirent dirent, *direntp;
  22. @@ -108,10 +108,8 @@ static int _recursive_rmdir_onedev(char
  23. failed=1;
  24. continue;
  25. }
  26. - if (mystat.st_dev != pdev)
  27. - continue;
  28. if (S_ISDIR(mystat.st_mode)) {
  29. - if (_recursive_rmdir_onedev(pathname, pdev, exclude, level+1) < 0)
  30. + if (_recursive_rmdir_onedev(pathname, exclude, level+1) < 0)
  31. failed=1;
  32. } else {
  33. if (unlink(pathname) < 0) {
  34. @@ -147,7 +145,7 @@ extern int lxc_rmdir_onedev(char *path,
  35. return -1;
  36. }
  37. - return _recursive_rmdir_onedev(path, mystat.st_dev, exclude, 0);
  38. + return _recursive_rmdir_onedev(path, exclude, 0);
  39. }
  40. static int mount_fs(const char *source, const char *target, const char *type)