diff options
author | NeilBrown <neilb@suse.de> | 2008-10-12 20:55:12 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2008-10-12 20:55:12 -0400 |
commit | 4bbf3771ca40d0aaec8316d0e7476b16010288e5 (patch) | |
tree | f7cba1f72612c5d2132f549881c46ff572e01933 /drivers/md/raid5.c | |
parent | d710e13812600037a723a673dc5c96a071de98d3 (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/raid5.c')
-rw-r--r-- | drivers/md/raid5.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index d72be4b89e64..a36a7435edf5 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 |