md: call md_stop_writes from md_stop
This moves the call to the other side of set_readonly, but that should not be an issue. This encapsulates in 'md_stop' all of the functionality for internally stopping the array, leaving all the interactions with externalities (sysfs, request_queue, gendisk) in do_md_stop. Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
@@ -4634,12 +4634,14 @@ static void md_stop_writes(mddev_t *mddev)
|
|||||||
|
|
||||||
static void md_stop(mddev_t *mddev)
|
static void md_stop(mddev_t *mddev)
|
||||||
{
|
{
|
||||||
|
md_stop_writes(mddev);
|
||||||
|
|
||||||
mddev->pers->stop(mddev);
|
mddev->pers->stop(mddev);
|
||||||
if (mddev->pers->sync_request && mddev->to_remove == NULL)
|
if (mddev->pers->sync_request && mddev->to_remove == NULL)
|
||||||
mddev->to_remove = &md_redundancy_group;
|
mddev->to_remove = &md_redundancy_group;
|
||||||
module_put(mddev->pers->owner);
|
module_put(mddev->pers->owner);
|
||||||
mddev->pers = NULL;
|
mddev->pers = NULL;
|
||||||
|
clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int md_set_readonly(mddev_t *mddev, int is_open)
|
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)
|
|||||||
err = -EBUSY;
|
err = -EBUSY;
|
||||||
} else if (mddev->pers) {
|
} else if (mddev->pers) {
|
||||||
|
|
||||||
md_stop_writes(mddev);
|
|
||||||
|
|
||||||
if (mddev->ro)
|
if (mddev->ro)
|
||||||
set_disk_ro(disk, 0);
|
set_disk_ro(disk, 0);
|
||||||
|
|
||||||
@@ -4710,7 +4710,6 @@ static int do_md_stop(mddev_t * mddev, int mode, int is_open)
|
|||||||
if (mddev->ro)
|
if (mddev->ro)
|
||||||
mddev->ro = 0;
|
mddev->ro = 0;
|
||||||
|
|
||||||
clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery);
|
|
||||||
err = 0;
|
err = 0;
|
||||||
}
|
}
|
||||||
mutex_unlock(&mddev->open_mutex);
|
mutex_unlock(&mddev->open_mutex);
|
||||||
|
Reference in New Issue
Block a user