Skip to content
  • NeilBrown's avatar
    md: raid1: Fix restoration of bio between failed read and write. · 698b18c1
    NeilBrown authored
    
    
    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: default avatarNeil Brown <neilb@suse.de>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    698b18c1