From: Jes Sorensen Date: Tue, 9 May 2017 20:58:55 +0000 (-0400) Subject: Monitor/check_array: Get array_disks from sysfs X-Git-Tag: mdadm-4.1-rc1~134 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12a9d21f4e9fd4d3a14129407f1e8da6d6444cd6;p=thirdparty%2Fmdadm.git Monitor/check_array: Get array_disks from sysfs Signed-off-by: Jes Sorensen --- diff --git a/Monitor.c b/Monitor.c index 9456efdb..fe6f2b4c 100644 --- a/Monitor.c +++ b/Monitor.c @@ -481,7 +481,7 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat, if (st->devnm[0] == 0) strcpy(st->devnm, fd2devnm(fd)); - sra = sysfs_read(-1, st->devnm, GET_LEVEL | GET_DEGRADED | + sra = sysfs_read(-1, st->devnm, GET_LEVEL | GET_DISKS | GET_DEGRADED | GET_MISMATCH); if (!sra) goto disappeared; @@ -641,7 +641,7 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat, st->spare = array.spare_disks; st->failed = sra->array.failed_disks; st->utime = array.utime; - st->raid = array.raid_disks; + st->raid = sra->array.raid_disks; st->err = 0; if ((st->active < st->raid) && st->spare == 0) retval = 1;