aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2006-06-26 03:27:41 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-26 12:58:37 -0400
commit7c7546ccf6463edbeee8d9aac6de7be1cd80d08a (patch)
tree56c1f734db9f8a66a7c8c5ef11fb35e07dbb2f91 /drivers/md/md.c
parent5fd6c1dce06ec24ef3de20fe0c7ecf2ba9fe5ef9 (diff)
[PATCH] md: allow a linear array to have drives added while active
Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c15
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