btrfs-progs: judge the return value of check_mounted more accurately
authorGui Hecheng <guihc.fnst@cn.fujitsu.com>
Thu, 20 Feb 2014 02:49:03 +0000 (10:49 +0800)
committerChris Mason <clm@fb.com>
Fri, 21 Mar 2014 13:23:21 +0000 (06:23 -0700)
commit51a40f6df01ea7e0673bd1b50a0d28e1def345f2
tree3bdc02616593f84e784eeae2b795736ab13da7f6
parent64fddab8ac0ad7970cf713cfecba5ab6ae90b09c
btrfs-progs: judge the return value of check_mounted more accurately

For btrfs-convert, btrfstune, btrfs rescue, they report "device busy"
when given a device that does not actually exist e.g.

# btrfstune -x abcdefg (this device does not exist)
$ ...device busy...

We deal with this case by add "ret < 0" error check when
judging the return value of check_mounted.

Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
btrfs-convert.c
btrfstune.c
cmds-rescue.c