summaryrefslogtreecommitdiffstats
path: root/Grow.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-03-09 08:53:09 +0100
committerNeilBrown <neilb@suse.de>2011-03-09 08:53:09 +0100
commit3cb2aed250ba4715b6906da134a6f1c860cda975 (patch)
treef1d3a358e83b6b1f1be78f0bd3f7955a11acace1 /Grow.c
parentGrow: don't try to use 'raid_disks' value for a container. (diff)
downloadmdadm-3cb2aed250ba4715b6906da134a6f1c860cda975.tar.xz
mdadm-3cb2aed250ba4715b6906da134a6f1c860cda975.zip
Grow: don't let analyse_change see new level from metadata.
This is a bit of a hack - probably analyse change needs to be re-written a bit to handle this properly. However when the metadata deduced the intermediate state for a reshaping array, the 'new_level' it sets should not be used to interpret the 'delta_disks' number. So in that case, hide the new_level while calling analyse_change. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Grow.c')
-rw-r--r--Grow.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Grow.c b/Grow.c
index e9327226..40cb9291 100644
--- a/Grow.c
+++ b/Grow.c
@@ -1649,7 +1649,13 @@ static int reshape_array(char *container, int fd, char *devname,
int done;
struct mdinfo *sra = NULL;
- msg = analyse_change(info, &reshape);
+ if (info->reshape_active) {
+ int new_level = info->new_level;
+ info->new_level = UnSet;
+ msg = analyse_change(info, &reshape);
+ info->new_level = new_level;
+ } else
+ msg = analyse_change(info, &reshape);
if (msg) {
fprintf(stderr, Name ": %s\n", msg);
goto release;