• NeilBrown's avatar
    md/raid10: Allow replacement device to be replace old drive. · 4ca40c2c
    NeilBrown authored
    When recovery finish and spare_active is called, check for a
    replace that might have just become fully synced and mark it
    as such, marking the original as failed.
    
    Then when the original is removed, move the replacement into
    its position.
    
    This means that 'replacement' and spontaneously become NULL in some
    situations.  Make sure we check for those.
    It also means that 'rdev' and 'replacement' could appear to be
    identical - check for that too.
    Signed-off-by: default avatarNeilBrown <neilb@suse.de>
    4ca40c2c
raid10.c 91.4 KB