if (st->ss != tst->ss ||
st->minor_version != tst->minor_version ||
- st->ss->compare_super(st, tst) != 0) {
+ st->ss->compare_super(st, tst, 1) != 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
char *d;
for (ap = arrays; ap; ap = ap->next) {
if (st->ss == ap->st->ss &&
- st->ss->compare_super(ap->st, st) == 0)
+ st->ss->compare_super(ap->st, st, 0) == 0)
break;
}
if (!ap) {
}
st2 = dup_super(st);
if (st2->ss->load_super(st2, dfd2, NULL) ||
- st->ss->compare_super(st, st2) != 0) {
+ st->ss->compare_super(st, st2, 1) != 0) {
pr_err("metadata mismatch between %s and chosen array %s\n",
devname, chosen_name);
close(dfd2);
* moved in, otherwise the superblock in 'st' is compared with
* 'tst'.
*/
- int (*compare_super)(struct supertype *st, struct supertype *tst);
+ int (*compare_super)(struct supertype *st, struct supertype *tst,
+ int verbose);
/* Load metadata from a single device. If 'devname' is not NULL
* print error messages as appropriate */
int (*load_super)(struct supertype *st, int fd, char *devname);
return 0;
}
-static int compare_super_ddf(struct supertype *st, struct supertype *tst)
+static int compare_super_ddf(struct supertype *st, struct supertype *tst,
+ int verbose)
{
/*
* return:
memcpy(dest, src, sizeof_imsm_dev(src, 0));
}
-static int compare_super_imsm(struct supertype *st, struct supertype *tst)
+static int compare_super_imsm(struct supertype *st, struct supertype *tst,
+ int verbose)
{
/*
* return:
*/
if (!check_env("IMSM_NO_PLATFORM") && first->hba && sec->hba) {
if (first->hba->type != sec->hba->type) {
- fprintf(stderr,
- "HBAs of devices do not match %s != %s\n",
- get_sys_dev_type(first->hba->type),
- get_sys_dev_type(sec->hba->type));
+ if (verbose)
+ pr_err("HBAs of devices do not match %s != %s\n",
+ get_sys_dev_type(first->hba->type),
+ get_sys_dev_type(sec->hba->type));
return 3;
}
+
if (first->orom != sec->orom) {
- fprintf(stderr,
- "HBAs of devices do not match %s != %s\n",
- first->hba->pci_id, sec->hba->pci_id);
+ if (verbose)
+ pr_err("HBAs of devices do not match %s != %s\n",
+ first->hba->pci_id, sec->hba->pci_id);
return 3;
}
+
}
/* if an anchor does not have num_raid_devs set then it is a free
if (st->ss != tst->ss ||
st->minor_version != tst->minor_version ||
- st->ss->compare_super(st, tst) != 0) {
+ st->ss->compare_super(st, tst, 1) != 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
return rv;
}
-static int compare_super0(struct supertype *st, struct supertype *tst)
+static int compare_super0(struct supertype *st, struct supertype *tst,
+ int verbose)
{
/*
* return:
return rv;
}
-static int compare_super1(struct supertype *st, struct supertype *tst)
+static int compare_super1(struct supertype *st, struct supertype *tst,
+ int verbose)
{
/*
* return: