diff options
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 1dd723d31882..fccc8343a250 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -4294,6 +4294,7 @@ static int do_md_stop(mddev_t * mddev, int mode, int is_open) | |||
4294 | { | 4294 | { |
4295 | int err = 0; | 4295 | int err = 0; |
4296 | struct gendisk *disk = mddev->gendisk; | 4296 | struct gendisk *disk = mddev->gendisk; |
4297 | mdk_rdev_t *rdev; | ||
4297 | 4298 | ||
4298 | if (atomic_read(&mddev->openers) > is_open) { | 4299 | if (atomic_read(&mddev->openers) > is_open) { |
4299 | printk("md: %s still in use.\n",mdname(mddev)); | 4300 | printk("md: %s still in use.\n",mdname(mddev)); |
@@ -4336,6 +4337,13 @@ static int do_md_stop(mddev_t * mddev, int mode, int is_open) | |||
4336 | /* tell userspace to handle 'inactive' */ | 4337 | /* tell userspace to handle 'inactive' */ |
4337 | sysfs_notify_dirent(mddev->sysfs_state); | 4338 | sysfs_notify_dirent(mddev->sysfs_state); |
4338 | 4339 | ||
4340 | list_for_each_entry(rdev, &mddev->disks, same_set) | ||
4341 | if (rdev->raid_disk >= 0) { | ||
4342 | char nm[20]; | ||
4343 | sprintf(nm, "rd%d", rdev->raid_disk); | ||
4344 | sysfs_remove_link(&mddev->kobj, nm); | ||
4345 | } | ||
4346 | |||
4339 | set_capacity(disk, 0); | 4347 | set_capacity(disk, 0); |
4340 | mddev->changed = 1; | 4348 | mddev->changed = 1; |
4341 | 4349 | ||
@@ -4356,7 +4364,6 @@ static int do_md_stop(mddev_t * mddev, int mode, int is_open) | |||
4356 | * Free resources if final stop | 4364 | * Free resources if final stop |
4357 | */ | 4365 | */ |
4358 | if (mode == 0) { | 4366 | if (mode == 0) { |
4359 | mdk_rdev_t *rdev; | ||
4360 | 4367 | ||
4361 | printk(KERN_INFO "md: %s stopped.\n", mdname(mddev)); | 4368 | printk(KERN_INFO "md: %s stopped.\n", mdname(mddev)); |
4362 | 4369 | ||
@@ -4368,13 +4375,6 @@ static int do_md_stop(mddev_t * mddev, int mode, int is_open) | |||
4368 | } | 4375 | } |
4369 | mddev->bitmap_offset = 0; | 4376 | mddev->bitmap_offset = 0; |
4370 | 4377 | ||
4371 | list_for_each_entry(rdev, &mddev->disks, same_set) | ||
4372 | if (rdev->raid_disk >= 0) { | ||
4373 | char nm[20]; | ||
4374 | sprintf(nm, "rd%d", rdev->raid_disk); | ||
4375 | sysfs_remove_link(&mddev->kobj, nm); | ||
4376 | } | ||
4377 | |||
4378 | /* make sure all md_delayed_delete calls have finished */ | 4378 | /* make sure all md_delayed_delete calls have finished */ |
4379 | flush_scheduled_work(); | 4379 | flush_scheduled_work(); |
4380 | 4380 | ||