Skip to content

Commit 7b5a34e

Browse files
committed
btrfs-progs: subvolume delete: enhance warning message when deleting default subvolume
There are more possible reason for EPERM when subvolume is deleted, deleting the default was not mentioned but can easily happen in practice. Signed-off-by: David Sterba <dsterba@suse.com>
1 parent f52ed84 commit 7b5a34e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Documentation/btrfs-subvolume.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ create [options] [<dest>/]<name> [[<dest2>/]<name2> ...]
7474
delete [options] [<subvolume> [<subvolume>...]], delete -i|--subvolid <subvolid> <path>
7575
Delete the subvolume(s) from the filesystem.
7676

77-
If *subvolume* is not a subvolume, btrfs returns an error but continues if
78-
there are more arguments to process.
77+
If *subvolume* is not a subvolume, the command returns an error but
78+
continues if there are more arguments to process.
7979

8080
If *--subvolid* is used, *path* must point to a btrfs filesystem. See
8181
:ref:`btrfs subvolume list<man-subvolume-list>` or
@@ -86,10 +86,10 @@ delete [options] [<subvolume> [<subvolume>...]], delete -i|--subvolid <subvolid>
8686
removed later in the background. The command returns immediately. See
8787
:ref:`btrfs subvolume sync<man-subvolume-sync>` how to wait until the subvolume gets completely removed.
8888

89-
The deletion does not involve full transaction commit by default due to
89+
The deletion does not involve a full transaction commit by default due to
9090
performance reasons. As a consequence, the subvolume may appear again after a
9191
crash. Use one of the *--commit* options to wait until the operation is
92-
safely stored on the device.
92+
safely stored on the device before the command returns.
9393

9494
Deleting subvolume needs sufficient permissions, by default the owner
9595
cannot delete it unless it's enabled by a mount option

cmds/subvolume.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ static int cmd_subvolume_delete(const struct cmd_struct *cmd, int argc, char **a
562562

563563
error_btrfs_util(err);
564564
if (saved_errno == EPERM)
565-
warning("deletion failed with EPERM, you don't have permissions or send may be in progress");
565+
warning("deletion failed with EPERM, you don't have permissions or send may be in progress or the subvolume is set as default");
566566
ret = 1;
567567
goto out;
568568
}

0 commit comments

Comments
 (0)