summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2014-02-12 13:44:37 +0800
committerChris Mason <clm@fb.com>2014-03-21 06:23:14 -0700
commit93f4f126ecee53533d798949e96033f6f850c027 (patch)
tree88637fb2ba3c9e8f6d60e85ff89602f1a3e82d8f
parent5218123d8ffe51dffd6852d2c7858178f64483c2 (diff)
btrfs-progs: Fix check_arg_type() which doesn't use realpath() result.
Fix a problem that does not use the result of realpath(), which caused check_arg_type() can't handle mount point which ends with a final '/'. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Cc: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
-rw-r--r--cmds-filesystem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index 39bd1ad6..2b2d068e 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -425,10 +425,10 @@ static int check_arg_type(char *input)
return -EINVAL;
if (realpath(input, path)) {
- if (is_block_device(input) == 1)
+ if (is_block_device(path) == 1)
return BTRFS_ARG_BLKDEV;
- if (is_mount_point(input) == 1)
+ if (is_mount_point(path) == 1)
return BTRFS_ARG_MNTPOINT;
return BTRFS_ARG_UNKNOWN;