aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 180949e94a7b..c194955aecae 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2695,6 +2695,7 @@ level_store(mddev_t *mddev, const char *buf, size_t len)
2695 ssize_t rv = len; 2695 ssize_t rv = len;
2696 struct mdk_personality *pers; 2696 struct mdk_personality *pers;
2697 void *priv; 2697 void *priv;
2698 mdk_rdev_t *rdev;
2698 2699
2699 if (mddev->pers == NULL) { 2700 if (mddev->pers == NULL) {
2700 if (len == 0) 2701 if (len == 0)
@@ -2774,6 +2775,12 @@ level_store(mddev_t *mddev, const char *buf, size_t len)
2774 mddev_suspend(mddev); 2775 mddev_suspend(mddev);
2775 mddev->pers->stop(mddev); 2776 mddev->pers->stop(mddev);
2776 module_put(mddev->pers->owner); 2777 module_put(mddev->pers->owner);
2778 /* Invalidate devices that are now superfluous */
2779 list_for_each_entry(rdev, &mddev->disks, same_set)
2780 if (rdev->raid_disk >= mddev->raid_disks) {
2781 rdev->raid_disk = -1;
2782 clear_bit(In_sync, &rdev->flags);
2783 }
2777 mddev->pers = pers; 2784 mddev->pers = pers;
2778 mddev->private = priv; 2785 mddev->private = priv;
2779 strlcpy(mddev->clevel, pers->name, sizeof(mddev->clevel)); 2786 strlcpy(mddev->clevel, pers->name, sizeof(mddev->clevel));