File 0003-Assemble-don-t-assemble-IMSM-array-without-OROM.patch of Package mdadm
From 7eee461e91df702d8f588955b03e5bbb07e1f88d Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.com>
Date: Wed, 29 Jul 2015 14:38:37 +1000
Subject: [PATCH] Assemble: don't assemble IMSM array without OROM.
If someone has an IMSM array, and disables RAID in the BIOS
and uses the devices for some other purpose, then they really don't
want mdadm to start syncing the array.
So don't assemble if OROM doesn't confirm it is OK.
There can still be problems for crash-dump not being able to find
the OROM. Some explicit work-around might be needed for that
rather than a more general workaround that can corrupt data.
Signed-off-by: NeilBrown <neilb@suse.com>
---
Assemble.c | 2 +-
Incremental.c | 9 ++++-----
2 files changed, 5 insertions(+), 6 deletions(-)
--- a/Assemble.c
+++ b/Assemble.c
@@ -1315,7 +1315,7 @@ try_again:
mddev ? mddev : "further assembly");
content = &info;
- if (st)
+ if (st && c->force)
st->ignore_hw_compat = 1;
num_devs = select_devices(devlist, ident, &st, &content, c,
inargv, auto_assem);
--- a/Incremental.c
+++ b/Incremental.c
@@ -130,8 +130,6 @@ int Incremental(struct mddev_dev *devlis
if (must_be_container(dfd)) {
if (!st)
st = super_by_fd(dfd, NULL);
- if (st)
- st->ignore_hw_compat = 1;
if (st && st->ss->load_container)
rv = st->ss->load_container(st, dfd, NULL);
@@ -205,7 +203,8 @@ int Incremental(struct mddev_dev *devlis
st, c->verbose);
goto out;
}
- st->ignore_hw_compat = 1;
+ st->ignore_hw_compat = 0;
+
if (st->ss->compare_super == NULL ||
st->ss->load_super(st, dfd, NULL)) {
if (c->verbose >= 0)
@@ -1139,6 +1138,7 @@ static int partition_try_spare(char *dev
if (st2 == NULL ||
st2->ss->load_super(st2, fd, NULL) < 0)
goto next;
+ st2->ignore_hw_compat = 0;
if (!st) {
/* Check domain policy again, this time referring to metadata */
@@ -1366,8 +1366,7 @@ restart:
struct supertype *st = super_by_fd(mdfd, NULL);
int ret = 0;
struct map_ent *map = NULL;
- if (st)
- st->ignore_hw_compat = 1;
+
if (st && st->ss->load_container)
ret = st->ss->load_container(st, mdfd, NULL);
close(mdfd);