summaryrefslogtreecommitdiff
path: root/Assemble.c
diff options
context:
space:
mode:
authorPawel Baldysiak <pawel.baldysiak@intel.com>2014-06-30 12:22:22 +0000
committerNeilBrown <neilb@suse.de>2014-07-08 11:39:23 +1000
commit0c21b485e4beb7bcfe631412a231f7c1ea1067bc (patch)
treee823b8b5ad90ac368616e065cd7b73fc4f046daa /Assemble.c
parent120ec6f7b96455e42bdfa9131c0c9026c57eaf19 (diff)
IMSM: Add warning message when assemble spanned container
Due to several changes in code assemble with disks spanned between different controllers can be obtained in some cases. After IMSM container will be assembled, check HBA of disks, and print proper warning if mismatch is detected. Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com> Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Assemble.c')
-rw-r--r--Assemble.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/Assemble.c b/Assemble.c
index 63e09ac3..aca28be7 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -1001,6 +1001,22 @@ static int start_array(int mdfd,
content->array.raid_disks);
fprintf(stderr, "\n");
}
+
+ if (st->ss->validate_container) {
+ struct mdinfo *devices_list;
+ struct mdinfo *info_devices = xmalloc(sizeof(struct mdinfo)*(okcnt+sparecnt));
+ unsigned int count;
+ devices_list = NULL;
+ for (count = 0; count < okcnt+sparecnt; count++) {
+ info_devices[count] = devices[count].i;
+ info_devices[count].next = devices_list;
+ devices_list = &info_devices[count];
+ }
+ if (st->ss->validate_container(devices_list))
+ pr_err("Mismatch detected!\n");
+ free(info_devices);
+ }
+
st->ss->free_super(st);
sysfs_uevent(content, "change");
if (err_ok && okcnt < (unsigned)content->array.raid_disks)