diff options
author | Guoqing Jiang <gqjiang@suse.com> | 2017-10-24 09:11:50 +0200 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2017-11-02 05:32:22 +0100 |
commit | d4098c7262a47f529765d89614484a957363d623 (patch) | |
tree | 34b9c412ec89d504034ddab14f12d8d0a83be312 | |
parent | md: use lockdep_assert_held (diff) | |
download | linux-d4098c7262a47f529765d89614484a957363d623.tar.xz linux-d4098c7262a47f529765d89614484a957363d623.zip |
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: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
-rw-r--r-- | drivers/md/raid10.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 615f677ceb1a..61890231972e 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -759,8 +759,11 @@ static struct md_rdev *read_balance(struct r10conf *conf, * the resync window. We take the first readable disk when * above the resync window. */ - if (conf->mddev->recovery_cp < MaxSector - && (this_sector + sectors >= conf->next_resync)) + if ((conf->mddev->recovery_cp < MaxSector + && (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; for (slot = 0; slot < conf->copies ; slot++) { |