aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5.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/raid5.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/raid5.c')
-rw-r--r--drivers/md/raid5.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 40e939675657..17e0953c3c06 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -4446,6 +4446,9 @@ static int raid5_check_reshape(mddev_t *mddev)
4446 return -EINVAL; /* Cannot shrink array or change level yet */ 4446 return -EINVAL; /* Cannot shrink array or change level yet */
4447 if (mddev->delta_disks == 0) 4447 if (mddev->delta_disks == 0)
4448 return 0; /* nothing to do */ 4448 return 0; /* nothing to do */
4449 if (mddev->bitmap)
4450 /* Cannot grow a bitmap yet */
4451 return -EBUSY;
4449 4452
4450 /* Can only proceed if there are plenty of stripe_heads. 4453 /* Can only proceed if there are plenty of stripe_heads.
4451 * We need a minimum of one full stripe,, and for sensible progress 4454 * We need a minimum of one full stripe,, and for sensible progress