summaryrefslogtreecommitdiffstats
path: root/super-intel.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--super-intel.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/super-intel.c b/super-intel.c
index a87af218..1017a447 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -1986,6 +1986,7 @@ static void imsm_set_array_state(struct active_array *a, int consistent)
if (a->resync_start == ~0ULL) {
failed = imsm_count_failed(super, map);
map_state = imsm_check_degraded(super, inst, failed);
+ /* complete recovery or initial resync */
if (!failed)
map_state = IMSM_T_STATE_NORMAL;
if (map->map_state != map_state) {
@@ -1994,13 +1995,20 @@ static void imsm_set_array_state(struct active_array *a, int consistent)
map->map_state = map_state;
super->updates_pending++;
}
- }
- if (dev->vol.dirty != dirty) {
- dprintf("imsm: mark '%s' (%llu)\n",
- dirty?"dirty":"clean", a->resync_start);
+ /* complete resync */
+ if (!dirty && dev->vol.dirty) {
+ dprintf("imsm: mark 'clean'\n");
+ dev->vol.dirty = 0;
+ super->updates_pending++;
+
+ }
+ }
- dev->vol.dirty = dirty;
+ /* mark dirty */
+ if (dirty && !dev->vol.dirty) {
+ dprintf("imsm: mark 'dirty' (%llu)\n", a->resync_start);
+ dev->vol.dirty = 1;
super->updates_pending++;
}
}