diff --git a/HISTORY b/HISTORY index 2cb15d9d..79b6d8ed 100644 --- a/HISTORY +++ b/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 diff --git a/cmdline/unix.c b/cmdline/unix.c index cf3f1627..d3193154 100644 --- a/cmdline/unix.c +++ b/cmdline/unix.c @@ -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;