• Jonathan Brassow's avatar
    dm raid: fix incorrect status output at the end of a "recover" process · 41dcf197
    Jonathan Brassow authored
    There are three important fields that indicate the overall health and
    status of an array: dev_health, sync_ratio, and sync_action.  They tell
    us the condition of the devices in the array, and the degree to which
    the array is synchronized.
    
    This commit fixes a condition that is reported incorrectly.  When a member
    of the array is being rebuilt or a new device is added, the "recover"
    process is used to synchronize it with the rest of the array.  When the
    process is complete, but the sync thread hasn't yet been reaped, it is
    possible for the state of MD to be:
     mddev->recovery = [ MD_RECOVERY_RUNNING MD_RECOVERY_RECOVER MD_RECOVERY_DONE ]
     curr_resync_completed = <max dev size> (but not MaxSector)
     and all rdevs to be In_sync.
    This causes the 'array_in_sync' output parameter that is passed to
    rs_get_progress() to be computed incorrectly and reported as 'false' --
    or not in-sync.  This in turn causes the dev_health status characters to
    be reported as all 'a', rather than the proper 'A'.
    
    This can cause erroneous output for several seconds at a time when tools
    will want to be checking the condition due to events that are raised at
    the end of a sync process.  Fix this by properly calculating the
    'array_in_sync' return parameter in rs_get_progress().
    
    Also, remove an unnecessary intermediate 'recovery_cp' variable in
    rs_get_progress().
    Signed-off-by: 's avatarJonathan Brassow <jbrassow@redhat.com>
    Signed-off-by: 's avatarMike Snitzer <snitzer@redhat.com>
    41dcf197
Name
Last commit
Last update
..
cache-policies.txt Loading commit data...
cache.txt Loading commit data...
delay.txt Loading commit data...
dm-crypt.txt Loading commit data...
dm-flakey.txt Loading commit data...
dm-integrity.txt Loading commit data...
dm-io.txt Loading commit data...
dm-log.txt Loading commit data...
dm-queue-length.txt Loading commit data...
dm-raid.txt Loading commit data...
dm-service-time.txt Loading commit data...
dm-uevent.txt Loading commit data...
dm-zoned.txt Loading commit data...
era.txt Loading commit data...
kcopyd.txt Loading commit data...
linear.txt Loading commit data...
log-writes.txt Loading commit data...
persistent-data.txt Loading commit data...
snapshot.txt Loading commit data...
statistics.txt Loading commit data...
striped.txt Loading commit data...
switch.txt Loading commit data...
thin-provisioning.txt Loading commit data...
verity.txt Loading commit data...
zero.txt Loading commit data...