summaryrefslogtreecommitdiffstats
path: root/drivers/md/md-cluster.c
diff options
context:
space:
mode:
authorGuoqing Jiang <gqjiang@suse.com>2018-10-18 10:37:43 +0200
committerShaohua Li <shli@fb.com>2018-10-18 18:36:35 +0200
commit5ebaf80bc8d5826edcc2d1cea26a7d5a4b8f01dd (patch)
tree0e166faec3a57e864b364e3bbfd944b996998c36 /drivers/md/md-cluster.c
parentmd-cluster/raid10: support add disk under grow mode (diff)
downloadlinux-5ebaf80bc8d5826edcc2d1cea26a7d5a4b8f01dd.tar.xz
linux-5ebaf80bc8d5826edcc2d1cea26a7d5a4b8f01dd.zip
md-cluster: introduce resync_info_get interface for sanity check
Since the resync region from suspend_info means one node is reshaping this area, so the position of reshape_progress should be included in the area. Reviewed-by: NeilBrown <neilb@suse.com> Signed-off-by: Guoqing Jiang <gqjiang@suse.com> Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/md-cluster.c')
-rw-r--r--drivers/md/md-cluster.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c
index e223fae80da3..ca4a35f8bad8 100644
--- a/drivers/md/md-cluster.c
+++ b/drivers/md/md-cluster.c
@@ -1323,6 +1323,19 @@ static int resync_start(struct mddev *mddev)
return dlm_lock_sync_interruptible(cinfo->resync_lockres, DLM_LOCK_EX, mddev);
}
+static void resync_info_get(struct mddev *mddev, sector_t *lo, sector_t *hi)
+{
+ struct md_cluster_info *cinfo = mddev->cluster_info;
+ struct suspend_info *s;
+
+ spin_lock_irq(&cinfo->suspend_lock);
+ list_for_each_entry(s, &cinfo->suspend_list, list) {
+ *lo = s->lo;
+ *hi = s->hi;
+ }
+ spin_unlock_irq(&cinfo->suspend_lock);
+}
+
static int resync_info_update(struct mddev *mddev, sector_t lo, sector_t hi)
{
struct md_cluster_info *cinfo = mddev->cluster_info;
@@ -1562,6 +1575,7 @@ static struct md_cluster_operations cluster_ops = {
.resync_start = resync_start,
.resync_finish = resync_finish,
.resync_info_update = resync_info_update,
+ .resync_info_get = resync_info_get,
.metadata_update_start = metadata_update_start,
.metadata_update_finish = metadata_update_finish,
.metadata_update_cancel = metadata_update_cancel,