linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: raz ben yehuda <raziebe@gmail.com>
To: Neil Brown <neilb@suse.de>, linux raid <linux-raid@vger.kernel.org>
Cc: ofer <ofer@bitband.com>, yaron <yaronp@bitband.com>
Subject: Subject: [PATCH 005/009]: raid0: chunk size check in raid0_run
Date: Tue, 19 May 2009 19:07:34 +0300	[thread overview]
Message-ID: <1242749254.3293.65.camel@raz> (raw)

have raid0 check chunk size in run method instead of in md
hardsect is short and chunksize am int, so i can use %.
 raid0.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
Signed-off-by: raziebe@gmail.com
---
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index a994169..b92b332 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -236,7 +236,17 @@ static int create_strip_zones(mddev_t *mddev)
 	mddev->queue->unplug_fn = raid0_unplug;
 	mddev->queue->backing_dev_info.congested_fn = raid0_congested;
 	mddev->queue->backing_dev_info.congested_data = mddev;
-
+	/*
+	* now since we have the hard sector sizes, we can make sure
+	* chunk size is a multiple of that sector size
+	* note! mdadm enforced 1K minimum for the chunk size.
+	*/
+	if (mddev->chunk_size % mddev->queue->hardsect_size) {
+		printk(KERN_ERR "%s chunk_size of %d not valid\n",
+				mdname(mddev),
+				mddev->chunk_size);
+		goto abort;
+	}
 	printk(KERN_INFO "raid0: done.\n");
 	mddev->private = conf;
 	return 0;



                 reply	other threads:[~2009-05-19 16:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1242749254.3293.65.camel@raz \
    --to=raziebe@gmail.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=ofer@bitband.com \
    --cc=yaronp@bitband.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).