Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit abb9b22a authored by Guoqing Jiang's avatar Guoqing Jiang Committed by NeilBrown
Browse files

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: default avatarGoldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: default avatarGuoqing Jiang <gqjiang@suse.com>
Signed-off-by: default avatarNeilBrown <neilb@suse.com>
parent eece075c
Loading
Loading
Loading
Loading
+15 −1
Original line number Original line Diff line number Diff line
@@ -625,6 +625,7 @@ static int gather_all_resync_info(struct mddev *mddev, int total_slots)
	struct dlm_lock_resource *bm_lockres;
	struct dlm_lock_resource *bm_lockres;
	struct suspend_info *s;
	struct suspend_info *s;
	char str[64];
	char str[64];
	sector_t lo, hi;




	for (i = 0; i < total_slots; i++) {
	for (i = 0; i < total_slots; i++) {
@@ -659,7 +660,20 @@ static int gather_all_resync_info(struct mddev *mddev, int total_slots)
			lockres_free(bm_lockres);
			lockres_free(bm_lockres);
			goto out;
			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);
		dlm_unlock_sync(bm_lockres);
		lockres_free(bm_lockres);
		lockres_free(bm_lockres);
	}
	}