mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Fix scanning of devices with multiple slaves
This commit is contained in:
parent
c4e08ae69d
commit
3f838753ca
2 changed files with 10 additions and 3 deletions
5
HISTORY
5
HISTORY
|
|
@ -1,6 +1,11 @@
|
|||
SnapRAID HISTORY
|
||||
================
|
||||
|
||||
11.3 2018/01 (WIP)
|
||||
==================
|
||||
* Fixed handing of Linux devices that have multiple slaves. This affects
|
||||
the smart/list/devices/down commands [Valentin Hilbig].
|
||||
|
||||
11.2 2017/12
|
||||
============
|
||||
* Fixed recognition of NTFS hardlinks. They behave differently than
|
||||
|
|
|
|||
|
|
@ -917,18 +917,20 @@ static int devtree(const char* name, const char* custom, dev_t device, devinfo_t
|
|||
|
||||
while ((dd = readdir(d)) != 0) {
|
||||
if (dd->d_name[0] != '.') {
|
||||
dev_t subdev;
|
||||
|
||||
/* for each slave, expand the full potential tree */
|
||||
pathprint(path, sizeof(path), "/sys/dev/block/%u:%u/slaves/%s/dev", major(device), minor(device), dd->d_name);
|
||||
|
||||
device = devread(path);
|
||||
if (!device) {
|
||||
subdev = devread(path);
|
||||
if (!subdev) {
|
||||
/* LCOV_EXCL_START */
|
||||
closedir(d);
|
||||
return -1;
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
if (devtree(name, custom, device, parent, list) != 0) {
|
||||
if (devtree(name, custom, subdev, parent, list) != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
closedir(d);
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue