• Neil Brown's avatar
    Fix various bugs with aligned reads in RAID5. · 789daef8
    Neil Brown authored
    Fix various bugs with aligned reads in RAID5.
    
    It is possible for raid5 to be sent a bio that is too big
    for an underlying device.  So if it is a READ that we
    pass stright down to a device, it will fail and confuse
    RAID5.
    
    So in 'chunk_aligned_read' we check that the bio fits within the
    parameters for the target device and if it doesn't fit, fall back
    on reading through the stripe cache and making lots of one-page
    requests.
    
    Note that this is the earliest time we can check against the device
    because earlier we don't have a lock on the device, so it could change
    underneath us.
    
    Also, the code for handling a retry through the cache when a read
    fails has not been tested and was badly broken.  This patch fixes that
    code.
    Signed-off-by: default avatarNeil Brown <neilb@suse.de>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    789daef8
raid5.c 114 KB