aboutsummaryrefslogtreecommitdiffstats
path: root/cmds-subvolume.c
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2014-07-23 13:47:35 +0800
committerDavid Sterba <dsterba@suse.cz>2014-08-22 15:07:02 +0200
commitde22c28ef31d9721606ba05965a093a8044be0de (patch)
tree2c5e2c942d927463160bf8c2b46e1c76d548d7be /cmds-subvolume.c
parent10c8f34f519451d763ae6b40bd388d11f4d3d42f (diff)
downloadbtrfs-progs-de22c28ef31d9721606ba05965a093a8044be0de.tar.gz
btrfs-progs-de22c28ef31d9721606ba05965a093a8044be0de.tar.xz
btrfs-progs-de22c28ef31d9721606ba05965a093a8044be0de.zip
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 <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'cmds-subvolume.c')
-rw-r--r--cmds-subvolume.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmds-subvolume.c b/cmds-subvolume.c
index 5e821c7..9ab5287 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);