diff options
author | Dan Williams <dan.j.williams@intel.com> | 2009-03-31 04:00:31 (GMT) |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-03-31 04:00:31 (GMT) |
commit | b522adcde9c4d3fb7b579cfa9160d8bde7744be8 (patch) | |
tree | 4208e3dcec3ebdfa6ad9bc153f76129400532717 /drivers/md/raid0.c | |
parent | 1f403624bde3c678a166984b1e6a727a0ce06f2b (diff) | |
download | linux-b522adcde9c4d3fb7b579cfa9160d8bde7744be8.tar.xz |
md: 'array_size' sysfs attribute
Allow userspace to set the size of the array according to the following
semantics:
1/ size must be <= to the size returned by mddev->pers->size(mddev, 0, 0)
a) If size is set before the array is running, do_md_run will fail
if size is greater than the default size
b) A reshape attempt that reduces the default size to less than the set
array size should be blocked
2/ once userspace sets the size the kernel will not change it
3/ writing 'default' to this attribute returns control of the size to the
kernel and reverts to the size reported by the personality
Also, convert locations that need to know the default size from directly
reading ->array_sectors to <pers>_size. Resync/reshape operations
always follow the default size.
Finally, fixup other locations that read a number of 1k-blocks from
userspace to use strict_blocks_to_sectors() which checks for unsigned
long long to sector_t overflow and blocks to sectors overflow.
Reviewed-by: Andre Noll <maan@systemlinux.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/md/raid0.c')
-rw-r--r-- | drivers/md/raid0.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index 6f7e538..c08d755 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -313,7 +313,7 @@ static int raid0_run (mddev_t *mddev) printk(KERN_INFO "raid0 : conf->spacing is %llu sectors.\n", (unsigned long long)conf->spacing); { - sector_t s = mddev->array_sectors; + sector_t s = raid0_size(mddev, 0, 0); sector_t space = conf->spacing; int round; conf->sector_shift = 0; |