mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-09 09:35:39 +00:00
fix btrfs_recursive_destroy
A change in kernel 4.2 caused btrfs_recursive_destroy to fail to delete unprivileged containers. This patch restores the pre-kernel-4.2 behaviour. Ref: Issue 935. Signed-off-by: Oleg Freedhom <overlayfs@gmail.com>
This commit is contained in:
parent
55c91e8367
commit
8ba6dc5e53
@ -616,8 +616,13 @@ static int btrfs_recursive_destroy(const char *path)
|
|||||||
ret = ioctl(fd, BTRFS_IOC_TREE_SEARCH, &args);
|
ret = ioctl(fd, BTRFS_IOC_TREE_SEARCH, &args);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
close(fd);
|
close(fd);
|
||||||
ERROR("Error: can't perform the search under %s\n", path);
|
|
||||||
free_btrfs_tree(tree);
|
free_btrfs_tree(tree);
|
||||||
|
if (errno == EPERM || errno == EACCES) {
|
||||||
|
WARN("Warn: can't perform the search under %s. Will simply try removing", path);
|
||||||
|
goto ignore_search;
|
||||||
|
}
|
||||||
|
|
||||||
|
ERROR("Error: can't perform the search under %s\n", path);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (sk->nr_items == 0)
|
if (sk->nr_items == 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user