• Jonathan Brassow's avatar
    dm raid1: handle read failures · 06386bbf
    Jonathan Brassow authored
    This patch gives the ability to respond-to/record device failures
    that happen during read operations.  It also adds the ability to
    read from mirror devices that are not the primary if they are
    in-sync.
    
    There are essentially two read paths in mirroring; the direct path
    and the queued path.  When a read request is mapped, if the region
    is 'in-sync' the direct path is taken; otherwise the queued path
    is taken.
    
    If the direct path is taken, we must record bio information so that
    if the read fails we can retry it.  We then discover the status of
    a direct read through mirror_end_io.  If the read has failed, we will
    mark the device from which the read was attempted as failed (so we
    don't try to read from it again), restore the bio and try again.
    
    If the queued path is taken, we discover the results of the read
    from 'read_callback'.  If the device failed, we will mark the device
    as failed and attempt the read again if there is another device
    where this region is known to be 'in-sync'.
    Signed-off-by: default avatarJonathan Brassow <jbrassow@redhat.com>
    Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
    06386bbf
dm-raid1.c 43.5 KB