]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Monitor/check_array: Get array_disks from sysfs
authorJes Sorensen <jsorensen@fb.com>
Tue, 9 May 2017 20:58:55 +0000 (16:58 -0400)
committerJes Sorensen <jsorensen@fb.com>
Tue, 9 May 2017 20:58:55 +0000 (16:58 -0400)
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Monitor.c

index 9456efdb9a9c5e3808abd9ce0d89ccd0496a875a..fe6f2b4c8820eda7bed0793c00011f0185605b68 100644 (file)
--- 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;