summaryrefslogtreecommitdiff
path: root/drivers/md/raid10.c
diff options
context:
space:
mode:
authorGuoqing Jiang <gqjiang@suse.com>2018-10-18 11:37:43 +0300
committerShaohua Li <shli@fb.com>2018-10-18 19:36:35 +0300
commit5ebaf80bc8d5826edcc2d1cea26a7d5a4b8f01dd (patch)
tree0e166faec3a57e864b364e3bbfd944b996998c36 /drivers/md/raid10.c
parent7564beda19b3646d781934d04fc382b738053e6f (diff)
downloadlinux-5ebaf80bc8d5826edcc2d1cea26a7d5a4b8f01dd.tar.xz
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/raid10.c')
-rw-r--r--drivers/md/raid10.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 1edd58a3098b..b98e746e7fc4 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -4785,8 +4785,14 @@ static void end_reshape(struct r10conf *conf)
static void raid10_update_reshape_pos(struct mddev *mddev)
{
struct r10conf *conf = mddev->private;
+ sector_t lo, hi;
- conf->reshape_progress = mddev->reshape_position;
+ md_cluster_ops->resync_info_get(mddev, &lo, &hi);
+ if (((mddev->reshape_position <= hi) && (mddev->reshape_position >= lo))
+ || mddev->reshape_position == MaxSector)
+ conf->reshape_progress = mddev->reshape_position;
+ else
+ WARN_ON_ONCE(1);
}
static int handle_reshape_read_error(struct mddev *mddev,