Detect level change

For level migration support it is necessary to allow mdmon to react for level changes.
It has to have ability to change configuration of active array,
and for array level change to raid0 finish array monitoring.

Signed-off-by: Maciej Trela <maciej.trela@intel.com>
Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
Adam Kwolek 2011-01-06 19:17:29 +11:00 committed by NeilBrown
parent ed08d51c1a
commit 57f8c76946
2 changed files with 13 additions and 1 deletions

View File

@ -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;

View File

@ -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;