tree 6fbe7fb44b1455516a406cf0f0596ea29b62eac1
parent 486a153f0e294f7cc735838edcb6b32e623cbe52
author NeilBrown <[EMAIL PROTECTED]> Sat, 10 Sep 2005 06:23:40 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Sat, 10 Sep 2005 06:39:09 -0700

[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 <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 drivers/md/raid10.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -538,7 +538,8 @@ static int read_balance(conf_t *conf, r1
        }
 
 
-       current_distance = abs(this_sector - conf->mirrors[disk].head_position);
+       current_distance = abs(r10_bio->devs[slot].addr -
+                              conf->mirrors[disk].head_position);
 
        /* Find the disk whose head is closest */
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to