• majianpeng's avatar
    md/raid5: Do not add data_offset before call to is_badblock · 6c0544e2
    majianpeng authored
    In chunk_aligned_read() we are adding data_offset before calling
    is_badblock.  But is_badblock also adds data_offset, so that is bad.
    
    So move the addition of data_offset to after the call to
    is_badblock.
    
    This bug was introduced by commit 31c176ec
         md/raid5: avoid reading from known bad blocks.
    which first appeared in 3.0.  So that patch is suitable for any
    -stable kernel from 3.0.y onwards.  However it will need minor
    revision for most of those (as the comment didn't appear until
    recently).
    
    Cc: stable@vger.kernel.org
    Signed-off-by: default avatarmajianpeng <majianpeng@gmail.com>
    Signed-off-by: default avatarNeilBrown <neilb@suse.de>
    6c0544e2
raid5.c 171 KB