diff options
author | Dan Williams <dan.j.williams@intel.com> | 2008-08-07 08:53:44 +0200 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2008-08-07 08:53:44 +0200 |
commit | 115c380305b15112716792bb03b5ea59d1ec6060 (patch) | |
tree | 78e56f3c0c5325c110b15341f22cbe3db25c436d | |
parent | imsm: raid5 layout is left-asymmetric (diff) | |
download | mdadm-115c380305b15112716792bb03b5ea59d1ec6060.tar.xz mdadm-115c380305b15112716792bb03b5ea59d1ec6060.zip |
imsm: do not mark arrays 'clean' if resync still in progress
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to '')
-rw-r--r-- | super-intel.c | 18 |
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++; } } |