md: raid10: chunk size check in run
authorraz ben yehuda <raziebe@gmail.com>
Tue, 16 Jun 2009 07:01:22 +0000 (17:01 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 16 Jun 2009 07:01:22 +0000 (17:01 +1000)
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>
drivers/md/raid10.c

index 9a5beb4fd954f147e0c6c86fd77b0c71bd7946ca..06bef686f91b93ea0192bd6b287c536ce2072a76 100644 (file)
@@ -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;
        }