summaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2013-05-09 01:48:30 +0200
committerNeilBrown <neilb@suse.de>2013-06-13 05:18:15 +0200
commit6b6204ee92adb53bfd6a77cb5679282ec3820c4b (patch)
tree750f1ac85412b93fae4cca92883fd6187380bc74 /drivers/md/md.c
parentMD: ignore discard request for hard disks of hybid raid1/raid10 array (diff)
downloadlinux-6b6204ee92adb53bfd6a77cb5679282ec3820c4b.tar.xz
linux-6b6204ee92adb53bfd6a77cb5679282ec3820c4b.zip
md: md_stop_writes() should always freeze recovery.
__md_stop_writes() will currently sometimes freeze recovery. So any caller must be ready for that to happen, and indeed they are. However if __md_stop_writes() doesn't freeze_recovery, then a recovery could start before mddev_suspend() is called, which could be awkward. This can particularly cause problems or dm-raid. So change __md_stop_writes() to always freeze recovery. This is safe and more predicatable. Reported-by: Brassow Jonathan <jbrassow@redhat.com> Tested-by: Brassow Jonathan <jbrassow@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to '')
-rw-r--r--drivers/md/md.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 4c74424c78b0..3e2acfa1696d 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5277,8 +5277,8 @@ static void md_clean(struct mddev *mddev)
static void __md_stop_writes(struct mddev *mddev)
{
+ set_bit(MD_RECOVERY_FROZEN, &mddev->recovery);
if (mddev->sync_thread) {
- set_bit(MD_RECOVERY_FROZEN, &mddev->recovery);
set_bit(MD_RECOVERY_INTR, &mddev->recovery);
md_reap_sync_thread(mddev);
}