]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - util.c
Allow --auto to still be meaningful when --scan is given
[thirdparty/mdadm.git] / util.c
diff --git a/util.c b/util.c
index 010764ea0661b5a8c0a7fbaa326e29fa9e9621da..05362c7a6d1b13518e08b6c991d1b6885926f44b 100644 (file)
--- a/util.c
+++ b/util.c
@@ -537,11 +537,15 @@ struct supertype *super_by_version(int vers, int minor)
 {
        struct supertype *st = malloc(sizeof(*st));
        if (!st) return st;
-       if (vers == 0)
+       if (vers == 0) {
                st->ss = &super0;
+               st->max_devs = MD_SB_DISKS;
+       }
 
-       if (vers == 1)
+       if (vers == 1) {
                st->ss = &super1;
+               st->max_devs = 384;
+       }
        st->minor_version = minor;
        return st;
 }
@@ -572,8 +576,8 @@ struct supertype *guess_super(int fd)
                            besttime < info.array.ctime) {
                                bestsuper = i;
                                besttime = info.array.ctime;
-                               st->ss = NULL;
                        }
+                       st->ss = NULL;
                        free(sbp);
                }
        }