aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2006-06-26 03:27:50 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-26 12:58:39 -0400
commit8838832830d2c6c28ae2db93188ae90652eb7fc2 (patch)
treed17a7027161352ea1893236dc6ea5bd309f6ceb4 /drivers/md
parentce25c31bdd3b39266debd86a7732007e05983a67 (diff)
[PATCH] md: Calculate correct array size for raid10 in new offset mode
The size calculation made assumtion which the new offset mode didn't follow. This gets the size right in all cases. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/raid10.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 4db34edfd87f..7f636283a1ba 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -2060,7 +2060,13 @@ static int run(mddev_t *mddev)
2060 /* 2060 /*
2061 * Ok, everything is just fine now 2061 * Ok, everything is just fine now
2062 */ 2062 */
2063 size = conf->stride * conf->raid_disks; 2063 if (conf->far_offset) {
2064 size = mddev->size >> (conf->chunk_shift-1);
2065 size *= conf->raid_disks;
2066 size <<= conf->chunk_shift;
2067 sector_div(size, conf->far_copies);
2068 } else
2069 size = conf->stride * conf->raid_disks;
2064 sector_div(size, conf->near_copies); 2070 sector_div(size, conf->near_copies);
2065 mddev->array_size = size/2; 2071 mddev->array_size = size/2;
2066 mddev->resync_max_sectors = size; 2072 mddev->resync_max_sectors = size;