提交 d4098c72 编写于 作者: G Guoqing Jiang 提交者: Shaohua Li

md-cluster/raid10: set "do_balance = 0" if area is resyncing

Just like clustered raid1, it is impossible for cluster raid10
to choose the best device for read balance when the area of
array is resyncing. Because we cannot trust the data to be the
same on all devices at that time, so we choose just the first
one to use, so set do_balance to 0.
Signed-off-by: NGuoqing Jiang <gqjiang@suse.com>
Signed-off-by: NShaohua Li <shli@fb.com>
上级 efa4b77b
...@@ -759,8 +759,11 @@ static struct md_rdev *read_balance(struct r10conf *conf, ...@@ -759,8 +759,11 @@ static struct md_rdev *read_balance(struct r10conf *conf,
* the resync window. We take the first readable disk when * the resync window. We take the first readable disk when
* above the resync window. * above the resync window.
*/ */
if (conf->mddev->recovery_cp < MaxSector if ((conf->mddev->recovery_cp < MaxSector
&& (this_sector + sectors >= conf->next_resync)) && (this_sector + sectors >= conf->next_resync)) ||
(mddev_is_clustered(conf->mddev) &&
md_cluster_ops->area_resyncing(conf->mddev, READ, this_sector,
this_sector + sectors)))
do_balance = 0; do_balance = 0;
for (slot = 0; slot < conf->copies ; slot++) { for (slot = 0; slot < conf->copies ; slot++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册