summaryrefslogtreecommitdiff
path: root/Grow.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2013-05-27 15:37:30 +1000
committerNeilBrown <neilb@suse.de>2013-05-28 16:58:18 +1000
commit8ecf12b9f87f790f1d1d51f7c43e2462e783384d (patch)
tree803955cb21407c401d712d3095e87805598dae87 /Grow.c
parent26bf55874d9fa6ca856455a6f112225825fde3c9 (diff)
Grow_continue: handle RESHAPE_NO_BACKUP correctly.
If the reshape does not require a backup, Grow_continue can abort early. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Grow.c')
-rw-r--r--Grow.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/Grow.c b/Grow.c
index 5e214f12..a3c8083c 100644
--- a/Grow.c
+++ b/Grow.c
@@ -2672,6 +2672,8 @@ static int reshape_array(char *container, int fd, char *devname,
/* reshape already started. just skip to monitoring the reshape */
if (reshape.backup_blocks == 0)
return 0;
+ if (restart & RESHAPE_NO_BACKUP)
+ return 0;
goto started;
}
/* The container is frozen but the array may not be.
@@ -2884,8 +2886,6 @@ static int reshape_array(char *container, int fd, char *devname,
goto release;
}
-started:
-
if (array.level == 10) {
/* Reshaping RAID10 does not require any data backup by
* user-space. Instead it requires that the data_offset
@@ -2943,6 +2943,7 @@ started:
break;
}
+started:
/* Decide how many blocks (sectors) for a reshape
* unit. The number we have so far is just a minimum
*/
@@ -4686,10 +4687,13 @@ int Grow_continue(int mdfd, struct supertype *st, struct mdinfo *info,
close(cfd);
ret_val = reshape_container(st->container_devnm, NULL, mdfd,
st, info, 0, backup_file,
- 0, 1, freeze_reshape);
+ 0,
+ 1 | info->reshape_active,
+ freeze_reshape);
} else
ret_val = reshape_array(NULL, mdfd, "array", st, info, 1,
- NULL, 0ULL, backup_file, 0, 0, 1,
+ NULL, 0ULL, backup_file, 0, 0,
+ 1 | info->reshape_active,
freeze_reshape);
return ret_val;