mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-23 22:53:35 +00:00
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>
This commit is contained in:
parent
681813b797
commit
133e4520ea
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user