aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorNeilBrown <neilb@cse.unsw.edu.au>2005-09-09 19:23:40 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-09 19:39:09 -0400
commit3ec67ac1a399d576d48b0736096bcce7721fe3cf (patch)
tree6fbe7fb44b1455516a406cf0f0596ea29b62eac1 /drivers
parent486a153f0e294f7cc735838edcb6b32e623cbe52 (diff)
[PATCH] md: fix minor error in raid10 read-balancing calculation.
'this_sector' is a virtual (array) address while 'head_position' is a physical (device) address, so substraction doesn't make any sense. devs[slot].addr should be used instead of this_sector. However, this patch doesn't make much practical different to the read balancing due to the effects of later code. Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/raid10.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 62ebb1bc72be..7239079203ec 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -538,7 +538,8 @@ static int read_balance(conf_t *conf, r10bio_t *r10_bio)
538 } 538 }
539 539
540 540
541 current_distance = abs(this_sector - conf->mirrors[disk].head_position); 541 current_distance = abs(r10_bio->devs[slot].addr -
542 conf->mirrors[disk].head_position);
542 543
543 /* Find the disk whose head is closest */ 544 /* Find the disk whose head is closest */
544 545