X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fmdadm.git;a=blobdiff_plain;f=util.c;h=0cb251c31d923d85a6a8fb198b854d9cdc2b6f49;hp=c2169d68dfa77d4590c918267f12e194a19fb470;hb=54887ad8cbb52ae3767b693c357a6c8d95af5da4;hpb=73c9c47c70e52e4018f0adbaee136ec0d505382b diff --git a/util.c b/util.c index c2169d68..0cb251c3 100644 --- a/util.c +++ b/util.c @@ -1087,7 +1087,7 @@ struct supertype *dup_super(struct supertype *orig) return st; } -struct supertype *guess_super(int fd) +struct supertype *guess_super_type(int fd, enum guess_types guess_type) { /* try each load_super to find the best match, * and return the best superswitch @@ -1102,6 +1102,10 @@ struct supertype *guess_super(int fd) for (i=0 ; superlist[i]; i++) { int rv; ss = superlist[i]; + if (guess_type == guess_array && ss->add_to_super == NULL) + continue; + if (guess_type == guess_partitions && ss->add_to_super != NULL) + continue; memset(st, 0, sizeof(*st)); rv = ss->load_super(st, fd, NULL); if (rv == 0) {