diff options
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index a296edd7e1c3..2ce750d4be02 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -817,8 +817,8 @@ static int super_90_validate(mddev_t *mddev, mdk_rdev_t *rdev) | |||
817 | 817 | ||
818 | if (desc->state & (1<<MD_DISK_FAULTY)) | 818 | if (desc->state & (1<<MD_DISK_FAULTY)) |
819 | set_bit(Faulty, &rdev->flags); | 819 | set_bit(Faulty, &rdev->flags); |
820 | else if (desc->state & (1<<MD_DISK_SYNC) && | 820 | else if (desc->state & (1<<MD_DISK_SYNC) /* && |
821 | desc->raid_disk < mddev->raid_disks) { | 821 | desc->raid_disk < mddev->raid_disks */) { |
822 | set_bit(In_sync, &rdev->flags); | 822 | set_bit(In_sync, &rdev->flags); |
823 | rdev->raid_disk = desc->raid_disk; | 823 | rdev->raid_disk = desc->raid_disk; |
824 | } | 824 | } |
@@ -3359,6 +3359,17 @@ static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info) | |||
3359 | 3359 | ||
3360 | rdev->raid_disk = -1; | 3360 | rdev->raid_disk = -1; |
3361 | err = bind_rdev_to_array(rdev, mddev); | 3361 | err = bind_rdev_to_array(rdev, mddev); |
3362 | if (!err && !mddev->pers->hot_remove_disk) { | ||
3363 | /* If there is hot_add_disk but no hot_remove_disk | ||
3364 | * then added disks for geometry changes, | ||
3365 | * and should be added immediately. | ||
3366 | */ | ||
3367 | super_types[mddev->major_version]. | ||
3368 | validate_super(mddev, rdev); | ||
3369 | err = mddev->pers->hot_add_disk(mddev, rdev); | ||
3370 | if (err) | ||
3371 | unbind_rdev_from_array(rdev); | ||
3372 | } | ||
3362 | if (err) | 3373 | if (err) |
3363 | export_rdev(rdev); | 3374 | export_rdev(rdev); |
3364 | 3375 | ||