summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--btrfs-debug-tree.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/btrfs-debug-tree.c b/btrfs-debug-tree.c
index e46500d8..9cdb35f9 100644
--- a/btrfs-debug-tree.c
+++ b/btrfs-debug-tree.c
@@ -179,6 +179,12 @@ int main(int ac, char **av)
if (check_argc_exact(ac, 1))
print_usage();
+ ret = check_arg_type(av[optind]);
+ if (ret != BTRFS_ARG_BLKDEV) {
+ fprintf(stderr, "'%s' is not a block device\n", av[optind]);
+ exit(1);
+ }
+
info = open_ctree_fs_info(av[optind], 0, 0, OPEN_CTREE_PARTIAL);
if (!info) {
fprintf(stderr, "unable to open %s\n", av[optind]);