btrfs-progs: Improve the errno string about open_path_or_dev_mnt()
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Mon, 28 Apr 2014 08:37:29 +0000 (16:37 +0800)
committerDavid Sterba <dsterba@suse.cz>
Fri, 22 Aug 2014 12:39:30 +0000 (14:39 +0200)
commitb81dd800fccc62754d1801a6c118ec7f629b0355
tree052c574dbb49414078e451a039a8faf0c88a8a2b
parent24cf4d8c3ee924b474f68514e0167cc2e602a48d
btrfs-progs: Improve the errno string about open_path_or_dev_mnt()

open_path_or_dev_mnt() is used to on *mounted* btrfs device or mount
point, when a unmounted btrfs device is passed, errno is set to EINVAL to
info the caller.
If ignore the errno and just print "ERROR: can't access '%s'", end users
will get confused.

This patch will add check for open_path_or_dev_mnt() caller and print
more meaningful error message when a unmounted btrfs device path is
given.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
cmds-device.c
cmds-replace.c
cmds-scrub.c