From bf2495ec080fa125b1fcb91af57da98a66692efe Mon Sep 17 00:00:00 2001 From: yangsheng Date: Fri, 16 Mar 2012 00:18:29 +0800 Subject: [PATCH] LU-1218 proc: Recovery timer in proc always displays 0 Calculate remain recovery time for proc display. Signed-off-by: yang sheng Change-Id: I50c14859c704c7e2bc60b66b3d70350648feebb6 Reviewed-on: http://review.whamcloud.com/2334 Tested-by: Hudson Reviewed-by: James Simmons Tested-by: Maloo Reviewed-by: Mike Pershin Reviewed-by: Oleg Drokin --- lustre/obdclass/lprocfs_status.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index 4c54f62..88cf765 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -2275,8 +2275,12 @@ int lprocfs_obd_rd_recovery_status(char *page, char **start, off_t off, obd->obd_recovery_start) <= 0) goto out; if (lprocfs_obd_snprintf(&page, size, &len, "time_remaining: %lu\n", - cfs_time_current_sec() >= obd->obd_recovery_end ? 0 : - obd->obd_recovery_end - cfs_time_current_sec()) <= 0) + cfs_time_current_sec() >= + obd->obd_recovery_start + + obd->obd_recovery_timeout ? 0 : + obd->obd_recovery_start + + obd->obd_recovery_timeout - + cfs_time_current_sec()) <= 0) goto out; if (lprocfs_obd_snprintf(&page, size, &len,"connected_clients: %d/%d\n", obd->obd_connected_clients, -- 1.8.3.1