diff options
author | NeilBrown <neilb@suse.de> | 2006-06-26 07:27:50 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 16:58:39 (GMT) |
commit | 8838832830d2c6c28ae2db93188ae90652eb7fc2 (patch) | |
tree | d17a7027161352ea1893236dc6ea5bd309f6ceb4 /drivers/md/raid10.c | |
parent | ce25c31bdd3b39266debd86a7732007e05983a67 (diff) | |
download | linux-fsl-qoriq-8838832830d2c6c28ae2db93188ae90652eb7fc2.tar.xz |
[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/raid10.c')
-rw-r--r-- | drivers/md/raid10.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 4db34ed..7f63628 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -2060,7 +2060,13 @@ static int run(mddev_t *mddev) /* * Ok, everything is just fine now */ - size = conf->stride * conf->raid_disks; + if (conf->far_offset) { + size = mddev->size >> (conf->chunk_shift-1); + size *= conf->raid_disks; + size <<= conf->chunk_shift; + sector_div(size, conf->far_copies); + } else + size = conf->stride * conf->raid_disks; sector_div(size, conf->near_copies); mddev->array_size = size/2; mddev->resync_max_sectors = size; |