summaryrefslogtreecommitdiffstats
path: root/sysfs.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-03-08 06:10:29 +0100
committerNeilBrown <neilb@suse.de>2011-03-08 06:10:29 +0100
commit20a40eca4b40068f6a45b9eab67320bd5de56f11 (patch)
tree9fa3bf8972be7e11b6d51bda90831a2a9b06cc85 /sysfs.c
parentimsm: improve getinfo_super when reshape is in progress. (diff)
downloadmdadm-20a40eca4b40068f6a45b9eab67320bd5de56f11.tar.xz
mdadm-20a40eca4b40068f6a45b9eab67320bd5de56f11.zip
Change way that reshaping arrays with external-metadata are assembled.
Now that the external metadata handler must provide an md-compatible old/new geometry, sys_set_array can do all of the array set-up for an array that is undergoing reshape. That leave less for reshape_array to do. Also clean up how reshape_array tells if the reshape has started or not. Don't use ->reshape_active as that doesn't tell us anything consistent at this stage, only use the 'restart' flag passed in. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'sysfs.c')
-rw-r--r--sysfs.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sysfs.c b/sysfs.c
index 883a8348..a7dfcc29 100644
--- a/sysfs.c
+++ b/sysfs.c
@@ -574,8 +574,11 @@ int sysfs_set_array(struct mdinfo *info, int vers)
rv |= sysfs_set_num(info, NULL, "reshape_position",
info->reshape_progress);
rv |= sysfs_set_num(info, NULL, "chunk_size", info->new_chunk);
- /* Don't set layout or raid_disks here as they require some
- * analysis and are set by reshape_array
+ rv |= sysfs_set_num(info, NULL, "layout", info->new_layout);
+ rv |= sysfs_set_num(info, NULL, "raid_disks",
+ info->array.raid_disks + info->delta_disks);
+ /* We don't set 'new_level' here. That can only happen
+ * once the reshape completes.
*/
}
return rv;