summaryrefslogtreecommitdiff
path: root/Grow.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-01-31 17:09:20 +1100
committerNeilBrown <neilb@suse.de>2011-01-31 17:09:20 +1100
commitb8b286a639dd4ab19ace6f6c5dd092fbc3890276 (patch)
treecb6bf52e91a1b0bcb9a922db2981f6e339715ab3 /Grow.c
parent7f913e9b21cba3e522283b7f23d09fcddc37c218 (diff)
Make sure odisks is consistent between creating and using the fdlist
reshape_prepare_fdlist and child_monitor currently have slightly different ideas of the 'old number of raid devices' which can cause major confusion. So settle on one value, and assign it to odisks early and always use it. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Grow.c')
-rw-r--r--Grow.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Grow.c b/Grow.c
index 748fbf68..cdabce1f 100644
--- a/Grow.c
+++ b/Grow.c
@@ -1838,7 +1838,9 @@ started:
/* Now we need to open all these devices so we can read/write.
*/
- nrdisks = array.raid_disks + sra->array.spare_disks;
+ nrdisks = max(reshape.before.data_disks,
+ reshape.after.data_disks) + reshape.parity
+ + sra->array.spare_disks;
fdlist = malloc((1+nrdisks) * sizeof(int));
offsets = malloc((1+nrdisks) * sizeof(offsets[0]));
if (!fdlist || !offsets) {
@@ -1846,7 +1848,8 @@ started:
goto release;
}
- d = reshape_prepare_fdlist(devname, sra, array.raid_disks,
+ odisks = reshape.before.data_disks + reshape.parity;
+ d = reshape_prepare_fdlist(devname, sra, odisks,
nrdisks, blocks, backup_file,
fdlist, offsets);
if (d < 0) {
@@ -1998,8 +2001,6 @@ started:
fd = -1;
mlockall(MCL_FUTURE);
- odisks = reshape.before.data_disks + reshape.parity;
-
if (st->ss->external) {
/* metadata handler takes it from here */
done = st->ss->manage_reshape(