Skip to content

Commit

Permalink
md-cluster: Read the disk bitmap sb and check if it needs recovery
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Guoqing Jiang authored and NeilBrown committed Aug 31, 2015
1 parent eece075 commit abb9b22
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion drivers/md/md-cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ static int gather_all_resync_info(struct mddev *mddev, int total_slots)
struct dlm_lock_resource *bm_lockres;
struct suspend_info *s;
char str[64];
sector_t lo, hi;


for (i = 0; i < total_slots; i++) {
Expand Down Expand Up @@ -659,7 +660,20 @@ static int gather_all_resync_info(struct mddev *mddev, int total_slots)
lockres_free(bm_lockres);
goto out;
}
/* TODO: Read the disk bitmap sb and check if it needs recovery */

/* Read the disk bitmap sb and check if it needs recovery */
ret = bitmap_copy_from_slot(mddev, i, &lo, &hi, false);
if (ret) {
pr_warn("md-cluster: Could not gather bitmaps from slot %d", i);
lockres_free(bm_lockres);
continue;
}
if ((hi > 0) && (lo < mddev->recovery_cp)) {
set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
mddev->recovery_cp = lo;
md_check_recovery(mddev);
}

dlm_unlock_sync(bm_lockres);
lockres_free(bm_lockres);
}
Expand Down

0 comments on commit abb9b22

Please sign in to comment.