Skip to contentSkip to conversation

Subject: [PATCH 005/009]: raid0: chunk size check in raid0_run

PATCH raz ben yehuda 1 participant 1 message May 19, 2009 MD RAID

lore
Share & tools
lore
#0 lore 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 [email protected]

---

drivers/md/raid0.c +11 -1
index a994169..b92b332 100644
@@ -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;