From ca62e637647f4d7c68bfb2b9f1b7a1597ae61381 Mon Sep 17 00:00:00 2001 From: Sergey Cheremencev Date: Thu, 14 Jan 2016 22:32:02 +0300 Subject: [PATCH] LU-8178 lproc: fix negative recovery_duration There is a window in target_recovery_thread where obd_recovery_end is not set despite of obd_recovering becomes 0. In such case recovery_duration shows difference between 0 and obd_recovery_start like below: recovery_duration: 18446744072323902150. Change-Id: Id385156585c99d12726e89980b55c588e0bf3ceb Signed-off-by: Sergey Cheremencev Seagate-bug-id: MRP-1519 Reviewed-by: Alexander Nikolaevich Boyko Reviewed-by: Artem Blagodarenko Tested-by: Parinay Vijayprakash Kondekar Reviewed-on: http://review.whamcloud.com/20381 Tested-by: Jenkins Reviewed-by: Alexander Boyko Reviewed-by: Mike Pershin Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/obdclass/lprocfs_status_server.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lustre/obdclass/lprocfs_status_server.c b/lustre/obdclass/lprocfs_status_server.c index d6ee00d..2790deb 100644 --- a/lustre/obdclass/lprocfs_status_server.c +++ b/lustre/obdclass/lprocfs_status_server.c @@ -578,7 +578,9 @@ int lprocfs_recovery_status_seq_show(struct seq_file *m, void *data) seq_printf(m, "COMPLETE\n"); seq_printf(m, "recovery_start: %lu\n", obd->obd_recovery_start); seq_printf(m, "recovery_duration: %lu\n", - obd->obd_recovery_end - obd->obd_recovery_start); + obd->obd_recovery_end ? + obd->obd_recovery_end - obd->obd_recovery_start : + cfs_time_current_sec() - obd->obd_recovery_start); /* Number of clients that have completed recovery */ seq_printf(m, "completed_clients: %d/%d\n", obd->obd_max_recoverable_clients - -- 1.8.3.1