@@ -149,7 +149,8 @@ only snapshot subvolumes in the filesystem will be listed.
-r::::
only readonly subvolumes in the filesystem will be listed.
-d::::
-list deleted subvolumes that are not yet cleaned.
+list deleted subvolumes that are not yet cleaned
+(require root privileges).
Other;;
-t::::
@@ -1569,6 +1569,7 @@ static const char * const cmd_subvol_list_usage[] = {
"-s list only snapshots",
"-r list readonly subvolumes (including snapshots)",
"-d list deleted subvolumes that are not yet cleaned",
+ " (require root privileges)",
"",
"Other:",
"-t print the result as a table",
@@ -1744,6 +1745,13 @@ static int cmd_subvol_list(int argc, char **argv)
goto out;
}
+ if (filter_set->only_deleted &&
+ (is_list_all || absolute_path || follow_mount)) {
+ ret = -1;
+ error("cannot use -d with -a/f/A option");
+ goto out;
+ }
+
subvol = argv[optind];
fd = btrfs_open_dir(subvol, &dirstream, 1);
if (fd < 0) {
Explicitly states that -d requires root privileges. Also, update some option handling with regard to -d option. Signed-off-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com> --- Documentation/btrfs-subvolume.asciidoc | 3 ++- cmds-subvolume.c | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-)