summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-04-01 12:08:16 +1100
committerNeilBrown <neilb@suse.de>2010-05-18 15:27:54 +1000
commitcca9cf90c504d98644ace52c474770970729f0eb (patch)
treed825b55dc2f8742b210479d2af1804b5b31dd791 /drivers/md
parenta4bd82d0d03b1485975579f131ccfd0aad6b7d6e (diff)
downloadlinux-3.10-cca9cf90c504d98644ace52c474770970729f0eb.tar.gz
linux-3.10-cca9cf90c504d98644ace52c474770970729f0eb.tar.bz2
linux-3.10-cca9cf90c504d98644ace52c474770970729f0eb.zip
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>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/md.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 3a2710a2e10..f48ba419cd7 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4634,12 +4634,14 @@ static void md_stop_writes(mddev_t *mddev)
static void md_stop(mddev_t *mddev)
{
+ md_stop_writes(mddev);
+
mddev->pers->stop(mddev);
if (mddev->pers->sync_request && mddev->to_remove == NULL)
mddev->to_remove = &md_redundancy_group;
module_put(mddev->pers->owner);
mddev->pers = NULL;
-
+ clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery);
}
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;
} else if (mddev->pers) {
- md_stop_writes(mddev);
-
if (mddev->ro)
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)
mddev->ro = 0;
- clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery);
err = 0;
}
mutex_unlock(&mddev->open_mutex);