]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Incremental.c
Always assume SKIP_GONE_DEVS behaviour and kill the flag
[thirdparty/mdadm.git] / Incremental.c
index d6dd0f43bef1e84786cb7dfb9fb75607edff3856..8062e2b17e154aab8c8224d8c81c4dfc7ecc2ebb 100644 (file)
@@ -369,6 +369,8 @@ int Incremental(char *devname, int verbose, int runstop,
                        strcpy(chosen_name, devnum2devname(mp->devnum));
 
                sra = sysfs_read(mdfd, fd2devnum(mdfd), (GET_DEVS | GET_STATE));
+               if (!sra)
+                       return 2;
 
                if (sra->devs) {
                        sprintf(dn, "%d:%d", sra->devs->disk.major,
@@ -586,6 +588,9 @@ static int count_active(struct supertype *st, int mdfd, char **availp,
        struct mdinfo *sra = sysfs_read(mdfd, -1, GET_DEVS | GET_STATE);
        char *avail = NULL;
 
+       if (!sra)
+               return 0;
+
        for (d = sra->devs ; d ; d = d->next) {
                char dn[30];
                int dfd;