From 115c380305b15112716792bb03b5ea59d1ec6060 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 6 Aug 2008 23:53:44 -0700 Subject: imsm: do not mark arrays 'clean' if resync still in progress Signed-off-by: Dan Williams --- super-intel.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'super-intel.c') 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++; } } -- cgit v1.2.3