]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Grow: use raid_disks, not nr_disks
authorNeilBrown <neilb@suse.de>
Fri, 6 Aug 2010 04:40:53 +0000 (14:40 +1000)
committerNeilBrown <neilb@suse.de>
Fri, 6 Aug 2010 04:40:53 +0000 (14:40 +1000)
nr_disks is just wrong here - the arrays need room for all disk slots,
even if some are empty, plus spares, plus a possible backup file.
So raid_disks is correct.

Signed-off-by: NeilBrown <neilb@suse.de>
Grow.c

diff --git a/Grow.c b/Grow.c
index 37674b850e9cd71fcbd5507b60d8a18bd794be46..0571f5b0e16d170e5bb9671d7f62df5f0cefa65c 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -979,7 +979,7 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file,
                        rv = 1;
                        break;
                }
-               nrdisks = array.nr_disks + sra->array.spare_disks;
+               nrdisks = array.raid_disks + sra->array.spare_disks;
                /* Now we need to open all these devices so we can read/write.
                 */
                fdlist = malloc((1+nrdisks) * sizeof(int));