• Heinz Mauelshagen's avatar
    dm raid: fix transient device failure processing · c63ede3b
    Heinz Mauelshagen authored
    This fix addresses the following 3 failure scenarios:
    
    1) If a (transiently) inaccessible metadata device is being passed into the
    constructor (e.g. a device tuple '254:4 254:5'), it is processed as if
    '- -' was given.  This erroneously results in a status table line containing
    '- -', which mistakenly differs from what has been passed in.  As a result,
    userspace libdevmapper puts the device tuple seperate from the RAID device
    thus not processing the dependencies properly.
    
    2) False health status char 'A' instead of 'D' is emitted on the status
    status info line for the meta/data device tuple in this metadata device
    failure case.
    
    3) If the metadata device is accessible when passed into the constructor
    but the data device (partially) isn't, that leg may be set faulty by the
    raid personality on access to the (partially) unavailable leg.  Restore
    tried in a second raid device resume on such failed leg (status char 'D')
    fails after the (partial) leg returned.
    
    Fixes for aforementioned failure scenarios:
    
    - don't release passed in devices in the constructor thus allowing the
      status table line to e.g. contain '254:4 254:5' rather than '- -'
    
    - emit device status char 'D' rather than 'A' for the device tuple
      with the failed metadata device on the status info line
    
    - when attempting to restore faulty devices in a second resume, allow the
      device hot remove function to succeed by setting the device to not in-sync
    
    In case userspace intentionally passes '- -' into the constructor to avoid that
    device tuple (e.g. to split off a raid1 leg temporarily for later re-addition),
    the status table line will correctly show '- -' and the status info line will
    provide a '-' device health character for the non-defined device tuple.
    Signed-off-by: default avatarHeinz Mauelshagen <heinzm@redhat.com>
    Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
    c63ede3b
dm-raid.txt 14.4 KB