From a5655dac75b6c572e1ef430b61ad55245fffd523 Mon Sep 17 00:00:00 2001 From: Lars Ellenberg Date: Tue, 11 Mar 2014 13:47:55 +0100 Subject: [PATCH] drbd: fix bogus resync stats in /proc/drbd 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: Philipp Reisner Signed-off-by: Lars Ellenberg --- Reading git-format-patch failed