- if (homehost) {
- int first = st->ss->match_home(st, homehost);
- int last = tst->ss->match_home(tst, homehost);
- if (first != last &&
- (first == 1 || last == 1)) {
- /* We can do something */
- if (first) {/* just ignore this one */
- if (report_missmatch)
- fprintf(stderr, Name ": %s misses out due to wrong homehost\n",
- devname);
- goto loop;
- } else { /* reject all those sofar */
- struct mddev_dev *td;
- if (report_missmatch)
- fprintf(stderr, Name ": %s overrides previous devices due to good homehost\n",
- devname);
- for (td=devlist; td != tmpdev; td=td->next)
- if (td->used == 1)
- td->used = 0;
- tmpdev->used = 1;
- goto loop;
+ }
+ close(dfd);
+
+ if (st == NULL)
+ st = dup_super(tst);
+ if (st->minor_version == -1)
+ st->minor_version = tst->minor_version;
+
+ if (memcmp(content->uuid, uuid_zero,
+ sizeof(int[4])) == 0) {
+ /* this is a floating spare. It cannot define
+ * an array unless there are no more arrays of
+ * this type to be found. It can be included
+ * in an array of this type though.
+ */
+ tmpdev->used = 3;
+ goto loop;
+ }
+
+ if (st->ss != tst->ss ||
+ st->minor_version != tst->minor_version ||
+ st->ss->compare_super(st, tst) != 0) {
+ /* Some mismatch. If exactly one array matches this host,
+ * we can resolve on that one.
+ * Or, if we are auto assembling, we just ignore the second
+ * for now.
+ */
+ if (auto_assem)
+ goto loop;
+ if (c->homehost) {
+ int first = st->ss->match_home(st, c->homehost);
+ int last = tst->ss->match_home(tst, c->homehost);
+ if (first != last &&
+ (first == 1 || last == 1)) {
+ /* We can do something */
+ if (first) {/* just ignore this one */
+ if (report_missmatch)
+ pr_err("%s misses out due to wrong homehost\n",
+ devname);
+ goto loop;
+ } else { /* reject all those sofar */
+ struct mddev_dev *td;
+ if (report_missmatch)
+ pr_err("%s overrides previous devices due to good homehost\n",
+ devname);
+ for (td=devlist; td != tmpdev; td=td->next)
+ if (td->used == 1)
+ td->used = 0;
+ tmpdev->used = 1;
+ goto loop;
+ }