summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--managemon.c12
-rw-r--r--monitor.c2
2 files changed, 13 insertions, 1 deletions
diff --git a/managemon.c b/managemon.c
index 9cb80499..269d06ed 100644
--- a/managemon.c
+++ b/managemon.c
@@ -448,6 +448,18 @@ static void manage_member(struct mdstat_ent *mdstat,
else
frozen = 1; /* can't read metadata_version assume the worst */
+ if (mdstat->level) {
+ int level = map_name(pers, mdstat->level);
+ if (a->info.array.level != level && level >= 0) {
+ struct active_array *newa = duplicate_aa(a);
+ if (newa) {
+ newa->info.array.level = level;
+ replace_array(a->container, a, newa);
+ a = newa;
+ }
+ }
+ }
+
if (a->check_degraded && !frozen) {
struct metadata_update *updates = NULL;
struct mdinfo *newdev = NULL;
diff --git a/monitor.c b/monitor.c
index 3962d9e9..4efe5da7 100644
--- a/monitor.c
+++ b/monitor.c
@@ -506,7 +506,7 @@ static int wait_and_act(struct supertype *container, int nowait)
/* once an array has been deactivated we want to
* ask the manager to discard it.
*/
- if (!a->container) {
+ if (!a->container || (a->info.array.level == 0)) {
if (discard_this) {
ap = &(*ap)->next;
continue;