diff options
author | Dan Williams <dan.j.williams@intel.com> | 2010-05-15 02:42:49 +0200 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2010-05-15 02:42:49 +0200 |
commit | 484240d8a3facde992009efd81bfa4cc0c79287d (patch) | |
tree | e8caef63af97a57817ab331256528f0836737ea3 /super-intel.c | |
parent | mdmon: fix missing open of md/<dev>/recovery_start (diff) | |
download | mdadm-484240d8a3facde992009efd81bfa4cc0c79287d.tar.xz mdadm-484240d8a3facde992009efd81bfa4cc0c79287d.zip |
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.c | 4 |
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; } } |