diff options
author | Arne Jansen <sensille@gmx.net> | 2011-11-29 08:40:28 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2013-01-18 18:26:27 +0100 |
commit | 133e4520eab88ee11b31afa4cbb012afdb0bbc28 (patch) | |
tree | 022ff582dc2e2a56b3a4d1049140efcead68bd22 /cmds-scrub.c | |
parent | 681813b7972dcdcd2e989389a6ed5e6b7794dd2b (diff) |
Btrfs-progs: bugfix for scrubbing single devices
Scrub can be invoked to scrub only a single device of a (mounted) filesystem.
The code determines whether the given path is a mountpoint of a filesystem
by issueing a btrfs-specific ioctl to it. Only in case of EINVAL it assumed
it may be a device, all other errnos just caused it fail, but some devices
(correctly) return ENOTTY. This patch adds this to the error check.
Signed-off-by: Arne Jansen <sensille@gmx.net>
Diffstat (limited to 'cmds-scrub.c')
-rw-r--r-- | cmds-scrub.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmds-scrub.c b/cmds-scrub.c index b864b2b9..b188996f 100644 --- a/cmds-scrub.c +++ b/cmds-scrub.c @@ -1002,7 +1002,7 @@ static int scrub_fs_info(char *path, } ret = ioctl(fd, BTRFS_IOC_FS_INFO, fi_args); - if (ret && errno == EINVAL) { + if (ret && (errno == EINVAL || errno == ENOTTY)) { /* path is no mounted btrfs. try if it's a device */ ret = check_mounted_where(fd, path, mp, sizeof(mp), &fs_devices_mnt); |