Skip to content

Commit

Permalink
md: Relax checks on ->max_disks when external metadata handling is used.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
NeilBrown committed May 18, 2010
1 parent b710310 commit 233fca3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -2801,8 +2801,9 @@ static void analyze_sbs(mddev_t * mddev)

i = 0;
rdev_for_each(rdev, tmp, mddev) {
if (rdev->desc_nr >= mddev->max_disks ||
i > mddev->max_disks) {
if (mddev->max_disks &&
(rdev->desc_nr >= mddev->max_disks ||
i > mddev->max_disks)) {
printk(KERN_WARNING
"md: %s: %s: only %d devices permitted\n",
mdname(mddev), bdevname(rdev->bdev, b),
Expand Down Expand Up @@ -5406,7 +5407,7 @@ static int update_raid_disks(mddev_t *mddev, int raid_disks)
if (mddev->pers->check_reshape == NULL)
return -EINVAL;
if (raid_disks <= 0 ||
raid_disks >= mddev->max_disks)
(mddev->max_disks && raid_disks >= mddev->max_disks))
return -EINVAL;
if (mddev->sync_thread || mddev->reshape_position != MaxSector)
return -EBUSY;
Expand Down

0 comments on commit 233fca3

Please sign in to comment.