summaryrefslogtreecommitdiff
path: root/Grow.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-03-09 18:47:24 +1100
committerNeilBrown <neilb@suse.de>2011-03-09 18:47:24 +1100
commit817ed7d6d6d92628aabc19e1216cbcbaf8c3450b (patch)
tree2b9798d0ada16faab9eb842168a896cc0c1cf914 /Grow.c
parenteae35f5c55281caa3ba6be0d77ad9a1c6b74bbd8 (diff)
Grow: only check 'native format' when really needed.
The check that the array info is already in 'native format' is only relevant when restarting a growth, so only perform it then. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Grow.c')
-rw-r--r--Grow.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Grow.c b/Grow.c
index ecbc837e..32263b0d 100644
--- a/Grow.c
+++ b/Grow.c
@@ -1651,9 +1651,10 @@ static int reshape_array(char *container, int fd, char *devname,
fprintf(stderr, Name ": %s\n", msg);
goto release;
}
- if (reshape.level != info->array.level ||
- reshape.before.layout != info->array.layout ||
- reshape.before.data_disks + reshape.parity != info->array.raid_disks) {
+ if (restart &&
+ (reshape.level != info->array.level ||
+ reshape.before.layout != info->array.layout ||
+ reshape.before.data_disks + reshape.parity != info->array.raid_disks)) {
fprintf(stderr, Name ": reshape info is not in native format -"
" cannot continue.\n");
goto release;