diff options
author | NeilBrown <neilb@suse.de> | 2012-05-22 13:55:27 +1000 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-05-22 13:55:27 +1000 |
commit | a4a6125a074e1b08ee8ae34f700c5bca19eb9d18 (patch) | |
tree | 761a719a7d4f1a53d44349f7bef095368a9ae75a /drivers/md/raid10.c | |
parent | b81a040481233e5171cb3fbc62f44636d5ea18b2 (diff) | |
download | kernel_goldelico_gta04-a4a6125a074e1b08ee8ae34f700c5bca19eb9d18.zip kernel_goldelico_gta04-a4a6125a074e1b08ee8ae34f700c5bca19eb9d18.tar.gz kernel_goldelico_gta04-a4a6125a074e1b08ee8ae34f700c5bca19eb9d18.tar.bz2 |
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>
Diffstat (limited to 'drivers/md/raid10.c')
-rw-r--r-- | drivers/md/raid10.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index fb9062b..8fe3aa4 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -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 && |