btrfs-progs: more scrub cancel error handling
authorEric Sandeen <sandeen@redhat.com>
Mon, 25 Feb 2013 22:54:41 +0000 (16:54 -0600)
committerDavid Sterba <dsterba@suse.cz>
Wed, 27 Feb 2013 13:39:39 +0000 (14:39 +0100)
commitd310e9cfffe0154d05ba2c8774241341307a6c76
tree5ff94bfaf2e3fe6ff0af8e9ead330a4840b66412
parent5eaeb577b563620f41735e0064d55ae41e969e78
btrfs-progs: more scrub cancel error handling

If we request scrub cancel on an unmounted or
non-btrfs device, we still get a "scrub canceled"
success message:

# btrfs scrub cancel /dev/loop1
scrub cancelled
# blkid /dev/loop1
/dev/loop1: UUID="7f586941-1d5e-4ba7-9caa-b35934849957" TYPE="xfs"

Fix this so that if check_mounted_where returns 0
we don't report success.

While we're at it, use perror to report the reason for an open
failure, if we get one.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
cmds-scrub.c