md: raid1: Fix restoration of bio between failed read and write.
authorNeilBrown <neilb@suse.de>
Fri, 23 May 2008 20:04:35 +0000 (13:04 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 24 May 2008 16:56:10 +0000 (09:56 -0700)
commit698b18c1e8bddf39cbf1ba50792b0fe302dbe6d6
tree9a65cf296b2b37654e30a1f2f9f6f13468259345
parent6be9d4940134b36f9ed020aead36f831f19b49f1
md: raid1: Fix restoration of bio between failed read and write.

When performing a "recovery" or "check" pass on a RAID1 array, we read
from each device and possible, if there is a difference or a read error,
write back to some devices.

We use the same 'bio' for both read and write, resetting various fields
between the two operations.

We forgot to reset bv_offset and bv_len however.  These are often left
unchanged, but in the case where there is an IO error one or two sectors
into a page, they are changed.

This results in correctable errors not being corrected properly.  It does
not result in any data corruption.

Cc: "Fairbanks, David" <David.Fairbanks@stratus.com>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/md/raid1.c