• Lars Ellenberg's avatar
    drbd: fix bogus resync stats in /proc/drbd · a5655dac
    Lars Ellenberg authored
    We intentionally do not serialize /proc/drbd access with
    internal state changes or statistic updates.
    
    Because of that, cat /proc/drbd  may race with resync just being
    finished, still see the sync state, and find information about
    number of blocks still to go, but then find the total number
    of blocks within this resync has just been reset to 0
    when accessing it.
    
    This now produces bogus numbers in the resync speed estimates.
    
    Fix by accessing all relevant data only once,
    and fixing it up if "still to go" happens to be more than "total".
    Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
    Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
    a5655dac
drbd_int.h 75.1 KB