btrfs-progs: subvol delete: update EPERM error message

The message could be confusing in case there's no send in progress and
the real reason is lack of permissions when deleting a subvolume.
Mention the permissions as first reason. Also update documentation.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2022-10-24 15:10:12 +02:00
parent f5e07cc60a
commit 447f976472
2 changed files with 4 additions and 1 deletions

View File

@ -79,6 +79,9 @@ delete [options] [<subvolume> [<subvolume>...]], delete -i|--subvolid <subvolid>
crash. Use one of the *--commit* options to wait until the operation is
safely stored on the device.
Deleting subvolume needs sufficient permissions, by default the owner
cannot delete it unless it's enabled by a mount option
*user_subvol_rm_allowed*, or deletion is run as root.
The default subvolume (see ``btrfs subvolume set-default``) cannot be deleted and
returns error (EPERM) and this is logged to the system log. A subvolume that's
currently involved in send (see ``btrfs send``) also cannot be deleted until the

View File

@ -423,7 +423,7 @@ again:
error_btrfs_util(err);
if (saved_errno == EPERM)
warning("deletion failed with EPERM, send may be in progress");
warning("deletion failed with EPERM, you don't have permissions or send may be in progress");
ret = 1;
goto out;
}