Skip to content

Commit eb315cd

Browse files
GuoqingJiangshligit
authored andcommitted
md-cluster: wake up thread to continue recovery
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>
1 parent 2c97cf1 commit eb315cd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/md/md-cluster.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,14 @@ static void recover_bitmaps(struct md_thread *thread)
284284
goto dlm_unlock;
285285
}
286286
if (hi > 0) {
287-
/* TODO:Wait for current resync to get over */
288-
set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
289287
if (lo < mddev->recovery_cp)
290288
mddev->recovery_cp = lo;
291-
md_check_recovery(mddev);
289+
/* wake up thread to continue resync in case resync
290+
* is not finished */
291+
if (mddev->recovery_cp != MaxSector) {
292+
set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
293+
md_wakeup_thread(mddev->thread);
294+
}
292295
}
293296
dlm_unlock:
294297
dlm_unlock_sync(bm_lockres);

0 commit comments

Comments
 (0)