summaryrefslogtreecommitdiffstats
path: root/drivers/md/md-cluster.c
diff options
context:
space:
mode:
authorGuoqing Jiang <gqjiang@suse.com>2015-07-10 17:01:22 +0800
committerNeilBrown <neilb@suse.com>2015-08-31 19:42:41 +0200
commitabb9b22ac948000ae156cd2d115c8632ec30a2ce (patch)
tree2a23410b44cbfd7d98ea1d0f04cbde36ced4e285 /drivers/md/md-cluster.c
parenteece075cda38f55fc5829b5f9ec5fb919c561d81 (diff)
downloadlinux-stable-abb9b22ac948000ae156cd2d115c8632ec30a2ce.tar.gz
linux-stable-abb9b22ac948000ae156cd2d115c8632ec30a2ce.tar.bz2
linux-stable-abb9b22ac948000ae156cd2d115c8632ec30a2ce.zip
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>
Diffstat (limited to 'drivers/md/md-cluster.c')
-rw-r--r--drivers/md/md-cluster.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c
index 29f65e2be025..c35a03a7eb11 100644
--- a/drivers/md/md-cluster.c
+++ b/drivers/md/md-cluster.c
@@ -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++) {
@@ -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);
}