All of lore.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 003 of 3] md: Calculate correct array size for raid10 in new offset mode.
Date: Tue, 16 May 2006 11:13:12 +1000	[thread overview]
Message-ID: <1060516011312.2735@suse.de> (raw)
In-Reply-To: 20060516111036.2649.patches@notabene


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>

### Diffstat output
 ./drivers/md/raid10.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff ./drivers/md/raid10.c~current~ ./drivers/md/raid10.c
--- ./drivers/md/raid10.c~current~	2006-05-16 11:09:25.000000000 +1000
+++ ./drivers/md/raid10.c	2006-05-16 11:09:42.000000000 +1000
@@ -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;

  parent reply	other threads:[~2006-05-16  1:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-16  1:12 [PATCH 000 of 3] md: Introduction - 3 bugfixs for -mm NeilBrown
2006-05-16  1:12 ` NeilBrown
2006-05-16  1:13 ` [PATCH 001 of 3] md: Change md/bitmap file handling to use bmap to file blocks-fix NeilBrown
2006-05-16  1:13   ` NeilBrown
2006-05-16  1:54   ` Andrew Morton
2006-05-16  2:16     ` Neil Brown
2006-05-16  1:13 ` [PATCH 002 of 3] md: Fix inverted test for 'repair' directive NeilBrown
2006-05-16  1:13 ` NeilBrown [this message]
2006-05-17 12:04 ` [PATCH 000 of 3] md: Introduction - 3 bugfixs for -mm Reuben Farrelly
2006-05-17 23:28   ` Neil Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1060516011312.2735@suse.de \
    --to=neilb@suse.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.