diff options
author | NeilBrown <neilb@suse.de> | 2010-04-14 03:02:09 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2010-05-18 01:27:49 -0400 |
commit | 233fca36bb439eadcad28500b5139fed7c64a0ae (patch) | |
tree | dfaec050a24564da4d05ec0e21cd814375eae1e8 /drivers/md | |
parent | b71031076e1169e89bdac1b245ad1488587e4730 (diff) |
md: Relax checks on ->max_disks when external metadata handling is used.
When metadata is being managed by user-space, md doesn't know
what the maximum number of devices allowed in an array is
so ->max_disks is 0. In this case we should allow any (+ve)
number of disks.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/md.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 766be8701281..46bdf4b38be8 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -2801,8 +2801,9 @@ static void analyze_sbs(mddev_t * mddev) | |||
2801 | 2801 | ||
2802 | i = 0; | 2802 | i = 0; |
2803 | rdev_for_each(rdev, tmp, mddev) { | 2803 | rdev_for_each(rdev, tmp, mddev) { |
2804 | if (rdev->desc_nr >= mddev->max_disks || | 2804 | if (mddev->max_disks && |
2805 | i > mddev->max_disks) { | 2805 | (rdev->desc_nr >= mddev->max_disks || |
2806 | i > mddev->max_disks)) { | ||
2806 | printk(KERN_WARNING | 2807 | printk(KERN_WARNING |
2807 | "md: %s: %s: only %d devices permitted\n", | 2808 | "md: %s: %s: only %d devices permitted\n", |
2808 | mdname(mddev), bdevname(rdev->bdev, b), | 2809 | mdname(mddev), bdevname(rdev->bdev, b), |
@@ -5406,7 +5407,7 @@ static int update_raid_disks(mddev_t *mddev, int raid_disks) | |||
5406 | if (mddev->pers->check_reshape == NULL) | 5407 | if (mddev->pers->check_reshape == NULL) |
5407 | return -EINVAL; | 5408 | return -EINVAL; |
5408 | if (raid_disks <= 0 || | 5409 | if (raid_disks <= 0 || |
5409 | raid_disks >= mddev->max_disks) | 5410 | (mddev->max_disks && raid_disks >= mddev->max_disks)) |
5410 | return -EINVAL; | 5411 | return -EINVAL; |
5411 | if (mddev->sync_thread || mddev->reshape_position != MaxSector) | 5412 | if (mddev->sync_thread || mddev->reshape_position != MaxSector) |
5412 | return -EBUSY; | 5413 | return -EBUSY; |