summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShaohua Li <shli@fb.com>2016-01-06 23:37:15 +0100
committerNeilBrown <neilb@suse.com>2016-01-14 01:49:43 +0100
commit16a43f6a65002ba9a5b063764b4ad5d288a1c15e (patch)
treeab7fa60d536626a106cab0130b42b49db311aa02
parentMD: add journal with array suspended (diff)
downloadlinux-16a43f6a65002ba9a5b063764b4ad5d288a1c15e.tar.xz
linux-16a43f6a65002ba9a5b063764b4ad5d288a1c15e.zip
raid5-cache: handle journal hotadd in quiesce
Handle journal hotadd in quiesce to avoid creating duplicated threads. Signed-off-by: Shaohua Li <shli@fb.com> Signed-off-by: NeilBrown <neilb@suse.com>
-rw-r--r--drivers/md/raid5-cache.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c
index 7ac035a73281..9531f5f05b93 100644
--- a/drivers/md/raid5-cache.c
+++ b/drivers/md/raid5-cache.c
@@ -827,6 +827,13 @@ void r5l_quiesce(struct r5l_log *log, int state)
return;
if (state == 0) {
log->in_teardown = 0;
+ /*
+ * This is a special case for hotadd. In suspend, the array has
+ * no journal. In resume, journal is initialized as well as the
+ * reclaim thread.
+ */
+ if (log->reclaim_thread)
+ return;
log->reclaim_thread = md_register_thread(r5l_reclaim_thread,
log->rdev->mddev, "reclaim");
} else if (state == 1) {