diff options
Diffstat (limited to 'drivers/md')
-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 3a2710a2e104..f48ba419cd7b 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -4634,12 +4634,14 @@ static void md_stop_writes(mddev_t *mddev) | |||
4634 | 4634 | ||
4635 | static void md_stop(mddev_t *mddev) | 4635 | static void md_stop(mddev_t *mddev) |
4636 | { | 4636 | { |
4637 | md_stop_writes(mddev); | ||
4638 | |||
4637 | mddev->pers->stop(mddev); | 4639 | mddev->pers->stop(mddev); |
4638 | if (mddev->pers->sync_request && mddev->to_remove == NULL) | 4640 | if (mddev->pers->sync_request && mddev->to_remove == NULL) |
4639 | mddev->to_remove = &md_redundancy_group; | 4641 | mddev->to_remove = &md_redundancy_group; |
4640 | module_put(mddev->pers->owner); | 4642 | module_put(mddev->pers->owner); |
4641 | mddev->pers = NULL; | 4643 | mddev->pers = NULL; |
4642 | 4644 | clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); | |
4643 | } | 4645 | } |
4644 | 4646 | ||
4645 | static int md_set_readonly(mddev_t *mddev, int is_open) | 4647 | static int md_set_readonly(mddev_t *mddev, int is_open) |
@@ -4684,8 +4686,6 @@ static int do_md_stop(mddev_t * mddev, int mode, int is_open) | |||
4684 | err = -EBUSY; | 4686 | err = -EBUSY; |
4685 | } else if (mddev->pers) { | 4687 | } else if (mddev->pers) { |
4686 | 4688 | ||
4687 | md_stop_writes(mddev); | ||
4688 | |||
4689 | if (mddev->ro) | 4689 | if (mddev->ro) |
4690 | set_disk_ro(disk, 0); | 4690 | set_disk_ro(disk, 0); |
4691 | 4691 | ||
@@ -4710,7 +4710,6 @@ static int do_md_stop(mddev_t * mddev, int mode, int is_open) | |||
4710 | if (mddev->ro) | 4710 | if (mddev->ro) |
4711 | mddev->ro = 0; | 4711 | mddev->ro = 0; |
4712 | 4712 | ||
4713 | clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); | ||
4714 | err = 0; | 4713 | err = 0; |
4715 | } | 4714 | } |
4716 | mutex_unlock(&mddev->open_mutex); | 4715 | mutex_unlock(&mddev->open_mutex); |