mirror of
https://github.com/Zygo/bees.git
synced 2025-06-16 01:26:18 +02:00
fs: handle ENOENT within lib
This prevents the storms of exceptions that occur when a subvol is deleted. We simply treat the entire tree as if it was empty. Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
@ -774,6 +774,11 @@ namespace crucible {
|
|||||||
ioctl_ptr->buf_size = buf_size;
|
ioctl_ptr->buf_size = buf_size;
|
||||||
// Don't bother supporting V1. Kernels that old have other problems.
|
// Don't bother supporting V1. Kernels that old have other problems.
|
||||||
int rv = ioctl(fd, BTRFS_IOC_TREE_SEARCH_V2, ioctl_arg.data());
|
int rv = ioctl(fd, BTRFS_IOC_TREE_SEARCH_V2, ioctl_arg.data());
|
||||||
|
if (rv != 0 && errno == ENOENT) {
|
||||||
|
// If we are searching a tree that is deleted or no longer exists, just return an empty list
|
||||||
|
nr_items = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (rv != 0 && errno != EOVERFLOW) {
|
if (rv != 0 && errno != EOVERFLOW) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user