Skip to content

Commit abb9b22

Browse files
GuoqingJiangNeilBrown
authored andcommitted
md-cluster: Read the disk bitmap sb and check if it needs recovery
In gather_all_resync_info, we need to read the disk bitmap sb and check if it needs recovery. Reviewed-by: Goldwyn Rodrigues <rgoldwyn@suse.com> Signed-off-by: Guoqing Jiang <gqjiang@suse.com> Signed-off-by: NeilBrown <neilb@suse.com>
1 parent eece075 commit abb9b22

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

drivers/md/md-cluster.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,7 @@ static int gather_all_resync_info(struct mddev *mddev, int total_slots)
625625
struct dlm_lock_resource *bm_lockres;
626626
struct suspend_info *s;
627627
char str[64];
628+
sector_t lo, hi;
628629

629630

630631
for (i = 0; i < total_slots; i++) {
@@ -659,7 +660,20 @@ static int gather_all_resync_info(struct mddev *mddev, int total_slots)
659660
lockres_free(bm_lockres);
660661
goto out;
661662
}
662-
/* TODO: Read the disk bitmap sb and check if it needs recovery */
663+
664+
/* Read the disk bitmap sb and check if it needs recovery */
665+
ret = bitmap_copy_from_slot(mddev, i, &lo, &hi, false);
666+
if (ret) {
667+
pr_warn("md-cluster: Could not gather bitmaps from slot %d", i);
668+
lockres_free(bm_lockres);
669+
continue;
670+
}
671+
if ((hi > 0) && (lo < mddev->recovery_cp)) {
672+
set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
673+
mddev->recovery_cp = lo;
674+
md_check_recovery(mddev);
675+
}
676+
663677
dlm_unlock_sync(bm_lockres);
664678
lockres_free(bm_lockres);
665679
}

0 commit comments

Comments
 (0)