md: allow array to be resized while bitmap is present.
Now that bitmaps can be resized, we can allow an array to be resized while the bitmap is present. This only covers resizing that involves changing the effective size of member devices, not resizing that changes the number of devices. Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
@@ -3678,9 +3678,15 @@ static int raid10_resize(struct mddev *mddev, sector_t sectors)
|
||||
|
||||
oldsize = raid10_size(mddev, 0, 0);
|
||||
size = raid10_size(mddev, sectors, 0);
|
||||
md_set_array_sectors(mddev, size);
|
||||
if (mddev->array_sectors > size)
|
||||
if (mddev->external_size &&
|
||||
mddev->array_sectors > size)
|
||||
return -EINVAL;
|
||||
if (mddev->bitmap) {
|
||||
int ret = bitmap_resize(mddev->bitmap, size, 0, 0);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
md_set_array_sectors(mddev, size);
|
||||
set_capacity(mddev->gendisk, mddev->array_sectors);
|
||||
revalidate_disk(mddev->gendisk);
|
||||
if (sectors > mddev->dev_sectors &&
|
||||
|
Reference in New Issue
Block a user