diff options
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 5d6fac1fd39e..45e255d4916f 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -1977,10 +1977,8 @@ slot_store(mdk_rdev_t *rdev, const char *buf, size_t len) | |||
1977 | rdev->saved_raid_disk = -1; | 1977 | rdev->saved_raid_disk = -1; |
1978 | err = rdev->mddev->pers-> | 1978 | err = rdev->mddev->pers-> |
1979 | hot_add_disk(rdev->mddev, rdev); | 1979 | hot_add_disk(rdev->mddev, rdev); |
1980 | if (err != 1) { | 1980 | if (err) { |
1981 | rdev->raid_disk = -1; | 1981 | rdev->raid_disk = -1; |
1982 | if (err == 0) | ||
1983 | return -EEXIST; | ||
1984 | return err; | 1982 | return err; |
1985 | } | 1983 | } |
1986 | sprintf(nm, "rd%d", rdev->raid_disk); | 1984 | sprintf(nm, "rd%d", rdev->raid_disk); |
@@ -5920,7 +5918,8 @@ static int remove_and_add_spares(mddev_t *mddev) | |||
5920 | if (rdev->raid_disk < 0 | 5918 | if (rdev->raid_disk < 0 |
5921 | && !test_bit(Faulty, &rdev->flags)) { | 5919 | && !test_bit(Faulty, &rdev->flags)) { |
5922 | rdev->recovery_offset = 0; | 5920 | rdev->recovery_offset = 0; |
5923 | if (mddev->pers->hot_add_disk(mddev,rdev)) { | 5921 | if (mddev->pers-> |
5922 | hot_add_disk(mddev, rdev) == 0) { | ||
5924 | char nm[20]; | 5923 | char nm[20]; |
5925 | sprintf(nm, "rd%d", rdev->raid_disk); | 5924 | sprintf(nm, "rd%d", rdev->raid_disk); |
5926 | if (sysfs_create_link(&mddev->kobj, | 5925 | if (sysfs_create_link(&mddev->kobj, |