From 447f976472dfa2f16205bdd66babbc7835f4f5ab Mon Sep 17 00:00:00 2001 From: David Sterba Date: Mon, 24 Oct 2022 15:10:12 +0200 Subject: [PATCH] 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 --- Documentation/btrfs-subvolume.rst | 3 +++ cmds/subvolume.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/btrfs-subvolume.rst b/Documentation/btrfs-subvolume.rst index ec8e088b..33598b9b 100644 --- a/Documentation/btrfs-subvolume.rst +++ b/Documentation/btrfs-subvolume.rst @@ -79,6 +79,9 @@ delete [options] [ [...]], delete -i|--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 diff --git a/cmds/subvolume.c b/cmds/subvolume.c index 0cc1abd2..adbac908 100644 --- a/cmds/subvolume.c +++ b/cmds/subvolume.c @@ -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; }