diff options
author | Shaohua Li <shli@fb.com> | 2016-11-21 13:29:19 -0500 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2016-11-23 22:30:25 -0500 |
commit | 034e33f5eda3c61edb838471f69ec42d64e1e94e (patch) | |
tree | de4cf540bbc599d64105a06a5b7d259363ca8db7 | |
parent | ce1ccd079fac0336191c0fd516ebf0e4985d59d4 (diff) |
md: stop write should stop journal reclaim
__md_stop_writes currently doesn't stop raid5-cache reclaim thread. It's
possible the reclaim thread is still running and doing write, which
doesn't match what __md_stop_writes should do. The extra ->quiesce()
call should not harm any raid types. For raid5-cache, this will
guarantee we reclaim all caches before we update superblock.
Signed-off-by: Shaohua Li <shli@fb.com>
Reviewed-by: NeilBrown <neilb@suse.de>
Cc: Song Liu <songliubraving@fb.com>
-rw-r--r-- | drivers/md/md.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 297757a0ec0c..c7894fbbd8e5 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -5517,6 +5517,10 @@ static void __md_stop_writes(struct mddev *mddev) | |||
5517 | 5517 | ||
5518 | del_timer_sync(&mddev->safemode_timer); | 5518 | del_timer_sync(&mddev->safemode_timer); |
5519 | 5519 | ||
5520 | if (mddev->pers && mddev->pers->quiesce) { | ||
5521 | mddev->pers->quiesce(mddev, 1); | ||
5522 | mddev->pers->quiesce(mddev, 0); | ||
5523 | } | ||
5520 | bitmap_flush(mddev); | 5524 | bitmap_flush(mddev); |
5521 | 5525 | ||
5522 | if (mddev->ro == 0 && | 5526 | if (mddev->ro == 0 && |