From: NeilBrown Date: Fri, 9 Sep 2005 23:23:40 +0000 (-0700) Subject: [PATCH] md: fix minor error in raid10 read-balancing calculation. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3ec67ac1a399d576d48b0736096bcce7721fe3cf;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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) } - 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 */