diff options
-rw-r--r-- | drivers/md/md-cluster.c | 14 | ||||
-rw-r--r-- | drivers/md/md-cluster.h | 1 | ||||
-rw-r--r-- | drivers/md/raid10.c | 8 |
3 files changed, 22 insertions, 1 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) | |||
1323 | return dlm_lock_sync_interruptible(cinfo->resync_lockres, DLM_LOCK_EX, mddev); | 1323 | return dlm_lock_sync_interruptible(cinfo->resync_lockres, DLM_LOCK_EX, mddev); |
1324 | } | 1324 | } |
1325 | 1325 | ||
1326 | static void resync_info_get(struct mddev *mddev, sector_t *lo, sector_t *hi) | ||
1327 | { | ||
1328 | struct md_cluster_info *cinfo = mddev->cluster_info; | ||
1329 | struct suspend_info *s; | ||
1330 | |||
1331 | spin_lock_irq(&cinfo->suspend_lock); | ||
1332 | list_for_each_entry(s, &cinfo->suspend_list, list) { | ||
1333 | *lo = s->lo; | ||
1334 | *hi = s->hi; | ||
1335 | } | ||
1336 | spin_unlock_irq(&cinfo->suspend_lock); | ||
1337 | } | ||
1338 | |||
1326 | static int resync_info_update(struct mddev *mddev, sector_t lo, sector_t hi) | 1339 | static int resync_info_update(struct mddev *mddev, sector_t lo, sector_t hi) |
1327 | { | 1340 | { |
1328 | struct md_cluster_info *cinfo = mddev->cluster_info; | 1341 | struct md_cluster_info *cinfo = mddev->cluster_info; |
@@ -1562,6 +1575,7 @@ static struct md_cluster_operations cluster_ops = { | |||
1562 | .resync_start = resync_start, | 1575 | .resync_start = resync_start, |
1563 | .resync_finish = resync_finish, | 1576 | .resync_finish = resync_finish, |
1564 | .resync_info_update = resync_info_update, | 1577 | .resync_info_update = resync_info_update, |
1578 | .resync_info_get = resync_info_get, | ||
1565 | .metadata_update_start = metadata_update_start, | 1579 | .metadata_update_start = metadata_update_start, |
1566 | .metadata_update_finish = metadata_update_finish, | 1580 | .metadata_update_finish = metadata_update_finish, |
1567 | .metadata_update_cancel = metadata_update_cancel, | 1581 | .metadata_update_cancel = metadata_update_cancel, |
diff --git a/drivers/md/md-cluster.h b/drivers/md/md-cluster.h index 9bd753a6a94e..a78e3021775d 100644 --- a/drivers/md/md-cluster.h +++ b/drivers/md/md-cluster.h | |||
@@ -14,6 +14,7 @@ struct md_cluster_operations { | |||
14 | int (*leave)(struct mddev *mddev); | 14 | int (*leave)(struct mddev *mddev); |
15 | int (*slot_number)(struct mddev *mddev); | 15 | int (*slot_number)(struct mddev *mddev); |
16 | int (*resync_info_update)(struct mddev *mddev, sector_t lo, sector_t hi); | 16 | int (*resync_info_update)(struct mddev *mddev, sector_t lo, sector_t hi); |
17 | void (*resync_info_get)(struct mddev *mddev, sector_t *lo, sector_t *hi); | ||
17 | int (*metadata_update_start)(struct mddev *mddev); | 18 | int (*metadata_update_start)(struct mddev *mddev); |
18 | int (*metadata_update_finish)(struct mddev *mddev); | 19 | int (*metadata_update_finish)(struct mddev *mddev); |
19 | void (*metadata_update_cancel)(struct mddev *mddev); | 20 | void (*metadata_update_cancel)(struct mddev *mddev); |
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) | |||
4785 | static void raid10_update_reshape_pos(struct mddev *mddev) | 4785 | static void raid10_update_reshape_pos(struct mddev *mddev) |
4786 | { | 4786 | { |
4787 | struct r10conf *conf = mddev->private; | 4787 | struct r10conf *conf = mddev->private; |
4788 | sector_t lo, hi; | ||
4788 | 4789 | ||
4789 | conf->reshape_progress = mddev->reshape_position; | 4790 | md_cluster_ops->resync_info_get(mddev, &lo, &hi); |
4791 | if (((mddev->reshape_position <= hi) && (mddev->reshape_position >= lo)) | ||
4792 | || mddev->reshape_position == MaxSector) | ||
4793 | conf->reshape_progress = mddev->reshape_position; | ||
4794 | else | ||
4795 | WARN_ON_ONCE(1); | ||
4790 | } | 4796 | } |
4791 | 4797 | ||
4792 | static int handle_reshape_read_error(struct mddev *mddev, | 4798 | static int handle_reshape_read_error(struct mddev *mddev, |