diff options
author | Zhao Lei <zhaolei@cn.fujitsu.com> | 2015-08-26 17:04:23 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2015-08-31 19:25:14 +0200 |
commit | abe48ca8600be7c8a7ec3c018b449ad3bd56c7a4 (patch) | |
tree | 90c49ec2b442d4dc6d27c19d478a6cb819e12b81 /tests/common | |
parent | 87c25626c4bef0700c4b165ddc128061ea31bd58 (diff) |
btrfs-progs: use btrfs_open_dir for btrfs device command
We can use btrfs_open_dir() to check whether the target dir is
under btrfs mount point before openning, instead of checking it in kernel
through ioctl, and returning a fuzzy error message.
Before patch:
# (/mnt/tmp is not btrfs mountpoint)
#
# btrfs device add -f /dev/sda13 /mnt/tmp
ERROR: error adding the device '/dev/sda13' - Inappropriate ioctl for device
#
After patch:
# btrfs device add -f /dev/sda13 /mnt/tmp
ERROR: not btrfs filesystem: /mnt/tmp
#
Similar fix for device remove and device usage.
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
[renamed to btrfs_open_dir]
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tests/common')
0 files changed, 0 insertions, 0 deletions