Fail safely when trying to grow an array with a write-intent bitmap.
We cannot currently change the size of a write-intent bitmap. So if we change the size of an array which has such a bitmap, it tries to set bits beyond the end of the bitmap. For now, simply reject any request to change the size of an array which has a bitmap. mdadm can remove the bitmap and add a new one after the array has changed size. Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
@@ -4639,6 +4639,11 @@ static int update_size(mddev_t *mddev, sector_t num_sectors)
|
||||
*/
|
||||
if (mddev->sync_thread)
|
||||
return -EBUSY;
|
||||
if (mddev->bitmap)
|
||||
/* Sorry, cannot grow a bitmap yet, just remove it,
|
||||
* grow, and re-add.
|
||||
*/
|
||||
return -EBUSY;
|
||||
rdev_for_each(rdev, tmp, mddev) {
|
||||
sector_t avail;
|
||||
avail = rdev->size * 2;
|
||||
|
Reference in New Issue
Block a user