diff options
author | Maciej Trela <Maciej.Trela@intel.com> | 2010-04-14 02:58:16 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2010-05-18 01:27:48 -0400 |
commit | b71031076e1169e89bdac1b245ad1488587e4730 (patch) | |
tree | b67a3ffc0263a7e380a9545ca066aea7cc46003b /drivers/md | |
parent | dab8b29248b3f14f456651a2a6ee9b8fd16d1b3c (diff) |
md: Correctly handle device removal via sysfs
Writing "none" to "../md/dev-xx/slot" removes that device
from being an active part of the array, but it didn't
set ->raid_disk to -1 to record this fact.
Signed-off-by: Maciej Trela <Maciej.Trela@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/md.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 7dcc74089550..766be8701281 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -2385,6 +2385,7 @@ slot_store(mdk_rdev_t *rdev, const char *buf, size_t len) | |||
2385 | return err; | 2385 | return err; |
2386 | sprintf(nm, "rd%d", rdev->raid_disk); | 2386 | sprintf(nm, "rd%d", rdev->raid_disk); |
2387 | sysfs_remove_link(&rdev->mddev->kobj, nm); | 2387 | sysfs_remove_link(&rdev->mddev->kobj, nm); |
2388 | rdev->raid_disk = -1; | ||
2388 | set_bit(MD_RECOVERY_NEEDED, &rdev->mddev->recovery); | 2389 | set_bit(MD_RECOVERY_NEEDED, &rdev->mddev->recovery); |
2389 | md_wakeup_thread(rdev->mddev->thread); | 2390 | md_wakeup_thread(rdev->mddev->thread); |
2390 | } else if (rdev->mddev->pers) { | 2391 | } else if (rdev->mddev->pers) { |