aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/md/md.c7
-rw-r--r--drivers/md/raid10.c5
-rw-r--r--drivers/md/raid5.c7
3 files changed, 11 insertions, 8 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index a29187d1fcf..be2014f6e37 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -3520,17 +3520,12 @@ static int do_md_run(mddev_t * mddev)
3520 return -EINVAL; 3520 return -EINVAL;
3521 } 3521 }
3522 /* 3522 /*
3523 * chunk-size has to be a power of 2 and multiples of PAGE_SIZE 3523 * chunk-size has to be a power of 2
3524 */ 3524 */
3525 if ( (1 << ffz(~chunk_size)) != chunk_size) { 3525 if ( (1 << ffz(~chunk_size)) != chunk_size) {
3526 printk(KERN_ERR "chunk_size of %d not valid\n", chunk_size); 3526 printk(KERN_ERR "chunk_size of %d not valid\n", chunk_size);
3527 return -EINVAL; 3527 return -EINVAL;
3528 } 3528 }
3529 if (chunk_size < PAGE_SIZE) {
3530 printk(KERN_ERR "too small chunk_size: %d < %ld\n",
3531 chunk_size, PAGE_SIZE);
3532 return -EINVAL;
3533 }
3534 3529
3535 /* devices must have minimum size of one chunk */ 3530 /* devices must have minimum size of one chunk */
3536 rdev_for_each(rdev, tmp, mddev) { 3531 rdev_for_each(rdev, tmp, mddev) {
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 8bdc9bfc288..e3794799f30 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -2028,8 +2028,9 @@ static int run(mddev_t *mddev)
2028 int nc, fc, fo; 2028 int nc, fc, fo;
2029 sector_t stride, size; 2029 sector_t stride, size;
2030 2030
2031 if (mddev->chunk_size == 0) { 2031 if (mddev->chunk_size < PAGE_SIZE) {
2032 printk(KERN_ERR "md/raid10: non-zero chunk size required.\n"); 2032 printk(KERN_ERR "md/raid10: chunk size must be "
2033 "at least PAGE_SIZE(%ld).\n", PAGE_SIZE);
2033 return -EINVAL; 2034 return -EINVAL;
2034 } 2035 }
2035 2036
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index d72be4b89e6..a36a7435edf 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -4007,6 +4007,13 @@ static int run(mddev_t *mddev)
4007 return -EIO; 4007 return -EIO;
4008 } 4008 }
4009 4009
4010 if (mddev->chunk_size < PAGE_SIZE) {
4011 printk(KERN_ERR "md/raid5: chunk_size must be at least "
4012 "PAGE_SIZE but %d < %ld\n",
4013 mddev->chunk_size, PAGE_SIZE);
4014 return -EINVAL;
4015 }
4016
4010 if (mddev->reshape_position != MaxSector) { 4017 if (mddev->reshape_position != MaxSector) {
4011 /* Check that we can continue the reshape. 4018 /* Check that we can continue the reshape.
4012 * Currently only disks can change, it must 4019 * Currently only disks can change, it must