aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-12-22 18:17:51 -0500
committerNeilBrown <neilb@suse.de>2011-12-22 18:17:51 -0500
commit476a7abb9b00adfe6bf70e82800367319ab8078b (patch)
tree92387465b8ded45abad9dbb7382136476a31e120 /drivers/md/md.c
parent915c420ddfa3eb22a0dbdb7a8e0ecf020c31961f (diff)
md: remove test for duplicate device when setting slot number.
When setting the slot number on a device in an active array we currently check that the number is not already in use. We then call into the personality's hot_add_disk function which performs the same test and returns the same error. Thus the common test is not needed. As we will shortly be changing some personalities to allow duplicates in some cases (to support hot-replace), the common test will become inconvenient. So remove the common test. Reviewed-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 004d8e5b2a57..d51c688d9c94 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2697,7 +2697,6 @@ slot_store(struct md_rdev *rdev, const char *buf, size_t len)
2697 set_bit(MD_RECOVERY_NEEDED, &rdev->mddev->recovery); 2697 set_bit(MD_RECOVERY_NEEDED, &rdev->mddev->recovery);
2698 md_wakeup_thread(rdev->mddev->thread); 2698 md_wakeup_thread(rdev->mddev->thread);
2699 } else if (rdev->mddev->pers) { 2699 } else if (rdev->mddev->pers) {
2700 struct md_rdev *rdev2;
2701 /* Activating a spare .. or possibly reactivating 2700 /* Activating a spare .. or possibly reactivating
2702 * if we ever get bitmaps working here. 2701 * if we ever get bitmaps working here.
2703 */ 2702 */
@@ -2711,10 +2710,6 @@ slot_store(struct md_rdev *rdev, const char *buf, size_t len)
2711 if (rdev->mddev->pers->hot_add_disk == NULL) 2710 if (rdev->mddev->pers->hot_add_disk == NULL)
2712 return -EINVAL; 2711 return -EINVAL;
2713 2712
2714 list_for_each_entry(rdev2, &rdev->mddev->disks, same_set)
2715 if (rdev2->raid_disk == slot)
2716 return -EEXIST;
2717
2718 if (slot >= rdev->mddev->raid_disks && 2713 if (slot >= rdev->mddev->raid_disks &&
2719 slot >= rdev->mddev->raid_disks + rdev->mddev->delta_disks) 2714 slot >= rdev->mddev->raid_disks + rdev->mddev->delta_disks)
2720 return -ENOSPC; 2715 return -ENOSPC;