* Subject: [PATCH 005/009]: raid0: chunk size check in raid0_run
@ 2009-05-19 16:07 raz ben yehuda
0 siblings, 0 replies; only message in thread
From: raz ben yehuda @ 2009-05-19 16:07 UTC (permalink / raw)
To: Neil Brown, linux raid; +Cc: ofer, yaron
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;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-05-19 16:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-19 16:07 Subject: [PATCH 005/009]: raid0: chunk size check in raid0_run raz ben yehuda
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.