summaryrefslogtreecommitdiffstats
path: root/drivers/md/raid10.c
diff options
context:
space:
mode:
authorraz ben yehuda <raziebe@gmail.com>2009-06-16 09:01:22 +0200
committerNeilBrown <neilb@suse.de>2009-06-16 09:01:22 +0200
commit964e7913b0d25b988e27a7cd9378bc55cc572bb4 (patch)
tree466f84698511b4b8639408530cfec0a2bd5dea4c /drivers/md/raid10.c
parentmd: raid0: chunk size check in raid0_run (diff)
downloadlinux-964e7913b0d25b988e27a7cd9378bc55cc572bb4.tar.xz
linux-964e7913b0d25b988e27a7cd9378bc55cc572bb4.zip
md: raid10: chunk size check in run
have raid10 check chunk size in run method instead of in md Signed-off-by: raziebe@gmail.com Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid10.c')
-rw-r--r--drivers/md/raid10.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 9a5beb4fd954..06bef686f91b 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -2050,9 +2050,10 @@ static int run(mddev_t *mddev)
int nc, fc, fo;
sector_t stride, size;
- if (mddev->chunk_size < PAGE_SIZE) {
+ if (mddev->chunk_size < PAGE_SIZE ||
+ !is_power_of_2(mddev->chunk_size)) {
printk(KERN_ERR "md/raid10: chunk size must be "
- "at least PAGE_SIZE(%ld).\n", PAGE_SIZE);
+ "at least PAGE_SIZE(%ld) and be a power of 2.\n", PAGE_SIZE);
return -EINVAL;
}