+ if (sysfs_get_ll(&a->info, NULL, "component_size", &component_size) >= 0)
+ a->info.component_size = component_size << 1;
+
+ /* honor 'frozen' */
+ if (sysfs_get_str(&a->info, NULL, "metadata_version", buf, sizeof(buf)) > 0)
+ frozen = buf[9] == '-';
+ else
+ frozen = 1; /* can't read metadata_version assume the worst */
+
+ /* If sync_action is not 'idle' then don't try recovery now */
+ if (!frozen
+ && sysfs_get_str(&a->info, NULL, "sync_action", buf, sizeof(buf)) > 0
+ && strncmp(buf, "idle", 4) != 0)
+ frozen = 1;
+
+ if (mdstat->level) {
+ int level = map_name(pers, mdstat->level);
+ if (level == 0 || level == LEVEL_LINEAR) {
+ a->to_remove = 1;
+ wakeup_monitor();
+ return;
+ }
+ else if (a->info.array.level != level && level > 0) {
+ struct active_array *newa = duplicate_aa(a);
+ if (newa) {
+ newa->info.array.level = level;
+ replace_array(container, a, newa);
+ a = newa;
+ }
+ }
+ }
+
+ /* we are after monitor kick,
+ * so container field can be cleared - check it again
+ */
+ if (a->container == NULL)
+ return;
+
+ /* We don't check the array while any update is pending, as it
+ * might container a change (such as a spare assignment) which
+ * could affect our decisions.
+ */
+ if (a->check_degraded && !frozen &&
+ update_queue == NULL && update_queue_pending == NULL) {