]> git.baikalelectronics.ru Git - kernel.git/commit
drbd: fix bogus resync stats in /proc/drbd
authorLars Ellenberg <lars.ellenberg@linbit.com>
Tue, 11 Mar 2014 12:47:55 +0000 (13:47 +0100)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Thu, 10 Jul 2014 16:34:59 +0000 (18:34 +0200)
commit5ccc28352fc8fd77c7f6f635a3c64c00079b3831
tree50636b7490394d34029daed62e4d023eccadcbf5
parent154861847700f895a2c3f066aab27b169997954e
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 <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_int.h
drivers/block/drbd/drbd_proc.c