aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2008-08-05 01:54:13 -0400
committerNeilBrown <neilb@suse.de>2008-08-05 01:56:32 -0400
commitdba034eef2456d2a9f9a76806846c97acf6c3ad1 (patch)
tree3cf51b72fc5be671e986a39c389aa5332994e2a2 /drivers/md/md.c
parent2b25000bf5157c28d8591f03f0575248a8cbd900 (diff)
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>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 8d11cd1a0d8b..6eb95451f161 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4639,6 +4639,11 @@ static int update_size(mddev_t *mddev, sector_t num_sectors)
4639 */ 4639 */
4640 if (mddev->sync_thread) 4640 if (mddev->sync_thread)
4641 return -EBUSY; 4641 return -EBUSY;
4642 if (mddev->bitmap)
4643 /* Sorry, cannot grow a bitmap yet, just remove it,
4644 * grow, and re-add.
4645 */
4646 return -EBUSY;
4642 rdev_for_each(rdev, tmp, mddev) { 4647 rdev_for_each(rdev, tmp, mddev) {
4643 sector_t avail; 4648 sector_t avail;
4644 avail = rdev->size * 2; 4649 avail = rdev->size * 2;