summaryrefslogtreecommitdiffstats
path: root/Grow.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-03-09 08:50:59 +0100
committerNeilBrown <neilb@suse.de>2011-03-09 08:50:59 +0100
commiteff4954d9a3e067bf495f7ee1bbe957879b732b4 (patch)
tree94639534474c8e7da618ec4f66c24d98599d3298 /Grow.c
parentGrow: only check 'native format' when really needed. (diff)
downloadmdadm-eff4954d9a3e067bf495f7ee1bbe957879b732b4.tar.xz
mdadm-eff4954d9a3e067bf495f7ee1bbe957879b732b4.zip
Grow: don't try to use 'raid_disks' value for a container.
The 'raid_disks' for a container is zero, so subtracting it from the given raid_disks to get delta_disks doesn't make sense. Rather set delta_disks to UnSet and set raid_disks to the requested number of disks. This then gets passed to reshape_super() which can use it as required. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Grow.c')
-rw-r--r--Grow.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Grow.c b/Grow.c
index 32263b0d..e9327226 100644
--- a/Grow.c
+++ b/Grow.c
@@ -1506,7 +1506,10 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file,
info.component_size = size*2;
info.new_level = level;
info.new_chunk = chunksize * 1024;
- if (raid_disks)
+ if (info.array.level == LEVEL_CONTAINER) {
+ info.delta_disks = UnSet;
+ info.array.raid_disks = raid_disks;
+ } else if (raid_disks)
info.delta_disks = raid_disks - info.array.raid_disks;
else
info.delta_disks = UnSet;