Skip to contentSkip to conversation

Fix raid1 read_balancing code.

PATCH New NeilBrown 1 participant 1 message Jun 14, 2004 1 message not in the archive MD RAID

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20040615094915.8393.patches@notabene

NeilBrown

author
#1 lore raw

PATCH 1/1 Fix raid1 read_balancing code.

The meaning of mddev->in_sync changed subtly a while ago, and raid1 wasn't changed to match. This results in raid1 read_balancing not working properly.
This patch corrects the relevant test.

### Diffstat output

 ./drivers/md/raid1.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)
drivers/md/raid1.c renamed from drivers/md/raid1.c~current~ +2 -1
diff ./drivers/md/raid1.c~current~ ./drivers/md/raid1.c
@@ -376,7 +376,8 @@ static int read_balance(conf_t *conf, st
 	 * device if no resync is going on, or below the resync window.
 	 * We take the first readable disk when above the resync window.
 	 */
-	if (!conf->mddev->in_sync && (this_sector + sectors >= conf->next_resync)) {
+	if (conf->mddev->recovery_cp < MaxSector &&
+	    (this_sector + sectors >= conf->next_resync)) {
 		/* make sure that disk is operational */
 		new_disk = 0;