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>
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;