summaryrefslogtreecommitdiff
path: root/sysfs.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-03-08 16:10:29 +1100
committerNeilBrown <neilb@suse.de>2011-03-08 16:10:29 +1100
commit20a40eca4b40068f6a45b9eab67320bd5de56f11 (patch)
tree9fa3bf8972be7e11b6d51bda90831a2a9b06cc85 /sysfs.c
parent3f83228aa83f00e83c15c1331d9e27c50c7a9fdc (diff)
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;