summaryrefslogtreecommitdiff
path: root/super-intel.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2010-05-14 17:42:49 -0700
committerDan Williams <dan.j.williams@intel.com>2010-05-14 17:42:49 -0700
commit484240d8a3facde992009efd81bfa4cc0c79287d (patch)
treee8caef63af97a57817ab331256528f0836737ea3 /super-intel.c
parent63b4aae33ebf00d443378daf313622630f2336c0 (diff)
mdmon: periodically checkpoint recovery
The kernel updates and notifies md/sync_completed when it is time to take a checkpoint. When this occurs (at 1/16 array size intervals) write 'idle' to md/sync_action to have the current recovery position updated in recovery_start and resync_start. Requires the metadata handler to reset ->last_checkpoint when it has determined that recovery has ended. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'super-intel.c')
-rw-r--r--super-intel.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/super-intel.c b/super-intel.c
index 677396c6..394ace41 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -4384,6 +4384,7 @@ static int imsm_set_array_state(struct active_array *a, int consistent)
dprintf("imsm: mark resync done\n");
end_migration(dev, map_state);
super->updates_pending++;
+ a->last_checkpoint = 0;
}
} else if (!is_resyncing(dev) && !failed) {
/* mark the start of the init process if nothing is failed */
@@ -4476,17 +4477,20 @@ static void imsm_set_disk(struct active_array *a, int n, int state)
map = get_imsm_map(dev, 0);
map->failed_disk_num = ~0;
super->updates_pending++;
+ a->last_checkpoint = 0;
} else if (map_state == IMSM_T_STATE_DEGRADED &&
map->map_state != map_state &&
!dev->vol.migr_state) {
dprintf("imsm: mark degraded\n");
map->map_state = map_state;
super->updates_pending++;
+ a->last_checkpoint = 0;
} else if (map_state == IMSM_T_STATE_FAILED &&
map->map_state != map_state) {
dprintf("imsm: mark failed\n");
end_migration(dev, map_state);
super->updates_pending++;
+ a->last_checkpoint = 0;
}
}