btrfs-progs: subvolume delete: print message for EPERM, possible send in progress

If subvolume deletion fails with EPERM, the most common reasons are that
it's a default subvolume (addressed by an earlier patch) or that the
subvolume is part of a send operation. This is printed to the system log
and there's no information available for user space, but at least the
warning can hint the user that something could be going on.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2020-09-29 23:45:30 +02:00
parent 8b4f9546c3
commit 74f45db76c

View File

@ -402,7 +402,11 @@ again:
else
err = btrfs_util_delete_subvolume_by_id_fd(fd, subvolid);
if (err) {
int saved_errno = errno;
error_btrfs_util(err);
if (saved_errno == EPERM)
warning("deletion failed with EPERM, send may be in progress");
ret = 1;
goto out;
}