From 73cc83d08e9413c33d21aece1f5d2425b3c3099d Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Mon, 5 Jan 2015 14:24:27 +0800 Subject: btrfs-progs: Allow debug-tree to be executed on regular file. The commit 1bad43fbe002 ("btrfs-progs: refine btrfs-debug-tree error prompt when a mount point given") add judgement on btrfs-debug-tree to restrict only block device to be executed on, but the command can also be used on regular file, so add regular file support for the judgement. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba --- btrfs-debug-tree.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'btrfs-debug-tree.c') diff --git a/btrfs-debug-tree.c b/btrfs-debug-tree.c index 9cdb35f9..0815fe1e 100644 --- a/btrfs-debug-tree.c +++ b/btrfs-debug-tree.c @@ -180,8 +180,9 @@ int main(int ac, char **av) print_usage(); ret = check_arg_type(av[optind]); - if (ret != BTRFS_ARG_BLKDEV) { - fprintf(stderr, "'%s' is not a block device\n", av[optind]); + if (ret != BTRFS_ARG_BLKDEV && ret != BTRFS_ARG_REG) { + fprintf(stderr, "'%s' is not a block device or regular file\n", + av[optind]); exit(1); } -- cgit v1.2.3