Commit 88388328 authored by NeilBrown's avatar NeilBrown Committed by Linus Torvalds

[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: default avatarNeil Brown <neilb@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ce25c31b
...@@ -2060,6 +2060,12 @@ static int run(mddev_t *mddev) ...@@ -2060,6 +2060,12 @@ static int run(mddev_t *mddev)
/* /*
* Ok, everything is just fine now * Ok, everything is just fine now
*/ */
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; size = conf->stride * conf->raid_disks;
sector_div(size, conf->near_copies); sector_div(size, conf->near_copies);
mddev->array_size = size/2; mddev->array_size = size/2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment