]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
set resync_start in Incremental_container
authorDan Williams <dan.j.williams@intel.com>
Thu, 15 May 2008 06:48:33 +0000 (16:48 +1000)
committerNeil Brown <neilb@suse.de>
Thu, 15 May 2008 06:48:33 +0000 (16:48 +1000)
From: Dan Williams <dan.j.williams@intel.com>

Metadata handlers set mdinfo.resync_start depending on the state of the
array.  By default mdadm assumes the array is dirty and needs a full
resync.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
mdadm.h
super-intel.c
sysfs.c

diff --git a/mdadm.h b/mdadm.h
index 27f0f3820b6962ce6dfc65d39bd6f58740c56b56..176d1c30319346936ba11230dc53a42132222665 100644 (file)
--- a/mdadm.h
+++ b/mdadm.h
@@ -147,6 +147,7 @@ struct mdinfo {
                                                 */
        int                     reshape_active;
        unsigned long long      reshape_progress;
+       unsigned long long      resync_start;
        int                     new_level, delta_disks, new_layout, new_chunk;
        int                     errors;
        int                     cache_size; /* size of raid456 stripe cache*/
index cfbf7721163cfdd0d32cdb09d0dbf3cc3b7f2e46..3c15ed294f1fc2399132fe6d8f715aee2d5ccdad 100644 (file)
@@ -1053,6 +1053,11 @@ static struct mdinfo *container_content_imsm(struct supertype *st)
                this->array.chunk_size = __le16_to_cpu(map->blocks_per_strip) << 9;
                this->array.state = !vol->dirty;
                this->container_member = i;
+               if (map->map_state == IMSM_T_STATE_UNINITIALIZED || dev->vol.dirty)
+                       this->resync_start = 0;
+               else
+                       this->resync_start = ~0ULL;
+
                strncpy(this->name, (char *) dev->volume, MAX_RAID_SERIAL_LEN);
                this->name[MAX_RAID_SERIAL_LEN] = 0;
 
diff --git a/sysfs.c b/sysfs.c
index 8b5a6ff507c8b4165107b2ac5520fa7c1c9d1003..f0e95122f7f59c281337696b2db31aa9304fef57 100644 (file)
--- a/sysfs.c
+++ b/sysfs.c
@@ -325,6 +325,7 @@ int sysfs_set_array(struct mdinfo *sra,
        rv |= sysfs_set_num(sra, NULL, "chunk_size", info->array.chunk_size);
        rv |= sysfs_set_num(sra, NULL, "layout", info->array.layout);
        rv |= sysfs_set_num(sra, NULL, "component_size", info->component_size);
+       rv |= sysfs_set_num(sra, NULL, "resync_start", info->resync_start);
        sra->array = info->array;
        return rv;
 }