summaryrefslogtreecommitdiff
path: root/cmds-subvolume.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-10-31 11:40:23 +0100
committerDavid Sterba <dsterba@suse.com>2016-11-09 13:47:29 +0100
commit8df2d94bf9eafa14c3960992bcb84e9985699893 (patch)
tree54a3e5e8934f4b6e3ecd0ee205945aba7ab82fe7 /cmds-subvolume.c
parent4383bf0c29bde58e0dadccc074d9d7b925b3e697 (diff)
btrfs-progs: subvol list: setup list filters later
First check for arguments and whether we can open the filesystem. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-subvolume.c')
-rw-r--r--cmds-subvolume.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmds-subvolume.c b/cmds-subvolume.c
index 3b5d6ea..0d2f973 100644
--- a/cmds-subvolume.c
+++ b/cmds-subvolume.c
@@ -530,10 +530,6 @@ static int cmd_subvol_list(int argc, char **argv)
}
}
- if (flags)
- btrfs_list_setup_filter(&filter_set, BTRFS_LIST_FILTER_FLAGS,
- flags);
-
if (check_argc_exact(argc - optind, 1)) {
uerr = 1;
goto out;
@@ -547,6 +543,10 @@ static int cmd_subvol_list(int argc, char **argv)
goto out;
}
+ if (flags)
+ btrfs_list_setup_filter(&filter_set, BTRFS_LIST_FILTER_FLAGS,
+ flags);
+
ret = btrfs_list_get_path_rootid(fd, &top_id);
if (ret)
goto out;