Commit 7fc0cdd1 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] md: Improve test for which raid1 device doesn't need to be written to.

Instead of testing last_used (which could change in unusual circumstances) we
test against the bdev that we read frmo, and don't write back to there.
parent 95e7ce7f
...@@ -825,7 +825,7 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio) ...@@ -825,7 +825,7 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
if (!conf->mirrors[i].rdev || if (!conf->mirrors[i].rdev ||
conf->mirrors[i].rdev->faulty) conf->mirrors[i].rdev->faulty)
continue; continue;
if (i == conf->last_used) if (conf->mirrors[i].rdev->bdev == bio->bi_bdev)
/* /*
* we read from here, no need to write * we read from here, no need to write
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment