aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2008-10-12 20:55:12 -0400
committerNeilBrown <neilb@suse.de>2008-10-12 20:55:12 -0400
commit4bbf3771ca40d0aaec8316d0e7476b16010288e5 (patch)
treef7cba1f72612c5d2132f549881c46ff572e01933 /drivers/md/md.c
parentd710e13812600037a723a673dc5c96a071de98d3 (diff)
md: Relax minimum size restrictions on chunk_size.
Currently, the 'chunk_size' of an array must be at-least PAGE_SIZE. This makes moving an array to a machine with a larger PAGE_SIZE, or changing the kernel to use a larger PAGE_SIZE, can stop an array from working. For RAID10 and RAID4/5/6, this is non-trivial to fix as the resync process works on whole pages at a time, and assumes them to be wholly within a stripe. For other raid personalities, this restriction is not needed at all and can be dropped. So remove the test on chunk_size from common can, and add it in just the places where it is needed: raid10 and raid4/5/6. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index a29187d1fcf5..be2014f6e37b 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) {