From de22c28ef31d9721606ba05965a093a8044be0de Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Wed, 23 Jul 2014 13:47:35 +0800 Subject: btrfs-progs: Check fstype in find_mount_root() When calling find_mount_root(), caller in fact wants to find the mount point of *BTRFS*. So also check ent->fstype in find_mount_root() and do special error string output in caller. This will suppress a lot of "Inapproiate ioctl for device" error message. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba --- cmds-subvolume.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cmds-subvolume.c') diff --git a/cmds-subvolume.c b/cmds-subvolume.c index 5e821c71..9ab5287b 100644 --- a/cmds-subvolume.c +++ b/cmds-subvolume.c @@ -933,6 +933,13 @@ static int cmd_subvol_show(int argc, char **argv) "%s\n", fullpath, strerror(-ret)); goto out; } + if (ret > 0) { + fprintf(stderr, + "ERROR: %s doesn't belong to btrfs mount point\n", + fullpath); + ret = -EINVAL; + goto out; + } ret = 1; svpath = get_subvol_name(mnt, fullpath); -- cgit v1.2.3