btrfs-progs: handle case if fsid not in sysfs in device_is_seed
For older kernels, the sysfs interface providing the fsid may not be present yet.
Since 32c2e57c65
("btrfs-progs: read fsid from the sysfs in
device_is_seed"), the fallback to the previous approach to determine
the fsid was not used anymore.
Ensure negative return values of sysfs_open_fsid_file are handled by
falling back to the dev_to_fsid in this case.
Pull-request: #599
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
d82c2ca63c
commit
8e11c07269
|
@ -726,7 +726,7 @@ static int device_is_seed(int fd, const char *dev_path, u64 devid, const u8 *mnt
|
|||
close(sysfs_fd);
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
if (ret || sysfs_fd < 0) {
|
||||
ret = dev_to_fsid(dev_path, fsid);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
Loading…
Reference in New Issue