* [PATCH 23/24] Read from the first device when an area is resyncing
@ 2014-12-18 16:19 Goldwyn Rodrigues
0 siblings, 0 replies; only message in thread
From: Goldwyn Rodrigues @ 2014-12-18 16:19 UTC (permalink / raw)
To: neilb; +Cc: lzhong, linux-raid
set choose_first true for cluster read in read balance when the area
is resyncing.
Signed-off-by: Lidong Zhong <lzhong@suse.com>
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
---
drivers/md/raid1.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index eb8fd2e..4dcbaae 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -540,7 +540,13 @@ static int read_balance(struct r1conf *conf, struct r1bio *r1_bio, int *max_sect
has_nonrot_disk = 0;
choose_next_idle = 0;
- choose_first = (conf->mddev->recovery_cp < this_sector + sectors);
+ if ((conf->mddev->recovery_cp < this_sector + sectors) ||
+ (mddev_is_clustered(conf->mddev) &&
+ md_cluster_ops->area_resyncing(conf->mddev, this_sector,
+ this_sector + sectors)))
+ choose_first = 1;
+ else
+ choose_first = 0;
for (disk = 0 ; disk < conf->raid_disks * 2 ; disk++) {
sector_t dist;
--
2.1.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-12-18 16:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-18 16:19 [PATCH 23/24] Read from the first device when an area is resyncing Goldwyn Rodrigues
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).