md-cluster: wake up thread to continue recovery
authorGuoqing Jiang <gqjiang@suse.com>
Mon, 2 May 2016 15:33:10 +0000 (11:33 -0400)
committerShaohua Li <shli@fb.com>
Wed, 4 May 2016 19:39:35 +0000 (12:39 -0700)
In recovery case, we need to set MD_RECOVERY_NEEDED
and wake up thread only if recover is not finished.

Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/md-cluster.c

index 12fbfeced238ebf6679c2f8948184690064ef4cf..0d4ddf85d607e2f4a78c03eab46c3755f63ef4e2 100644 (file)
@@ -284,11 +284,14 @@ static void recover_bitmaps(struct md_thread *thread)
                        goto dlm_unlock;
                }
                if (hi > 0) {
-                       /* TODO:Wait for current resync to get over */
-                       set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
                        if (lo < mddev->recovery_cp)
                                mddev->recovery_cp = lo;
-                       md_check_recovery(mddev);
+                       /* wake up thread to continue resync in case resync
+                        * is not finished */
+                       if (mddev->recovery_cp != MaxSector) {
+                           set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
+                           md_wakeup_thread(mddev->thread);
+                       }
                }
 dlm_unlock:
                dlm_unlock_sync(bm_lockres);
This page took 0.02582 seconds and 5 git commands to generate.