[PATCH] btrfs-progs: Fix check_arg_type() which doesn't use realpath() result.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
Cc: Anand Jain <anand.jain@xxxxxxxxxx>
---
 cmds-filesystem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index b12976f..e3c1156 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -448,10 +448,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;
-- 
1.8.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux