From c67b2005738a7d39fc6d3b2f0b228500ee754e46 Mon Sep 17 00:00:00 2001 From: "Christopher J. Morrone" Date: Sun, 26 Feb 2012 16:20:47 -0800 Subject: [PATCH] LU-1095 debug: Report remaining recovery time consistently Consistency is good, always report the remaining recovery time in the mm:ss format. This patch get's the last 3 remaining instances where it is simply reported as a total number of seconds. Signed-off-by: Christopher J. Morrone Change-Id: If5599d8c24b1cd862ab89670553fcd24672cadbc Reviewed-on: http://review.whamcloud.com/2204 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Minh Diep Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin (cherry picked from commit e8c6d2e9647b2dc95edddac5e902168816e7f57b) Reviewed-on: http://review.whamcloud.com/2834 --- lustre/ldlm/ldlm_lib.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index bc8f65b..c4aab4a 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -631,22 +631,25 @@ static int target_handle_reconnect(struct lustre_handle *conn, /* Might be a re-connect after a partition. */ if (!memcmp(&conn->cookie, &hdl->cookie, sizeof conn->cookie)) { - if (target->obd_recovering) + if (target->obd_recovering) { + int timeout = cfs_duration_sec(cfs_time_sub( + cfs_timer_deadline( + &target->obd_recovery_timer), + cfs_time_current())); + LCONSOLE_WARN("%s: Client %s (at %s) reconnect" - "ing, waiting for %d clients in " - "recovery for %lds\n", target->obd_name, + "ing, waiting for %d clients in recov" + "ery for %d:%.02d\n", target->obd_name, obd_uuid2str(&exp->exp_client_uuid), obd_export_nid2str(exp), target->obd_max_recoverable_clients, - cfs_duration_sec(cfs_time_sub( - cfs_timer_deadline( - &target->obd_recovery_timer), - cfs_time_current()))); - else + timeout / 60, timeout % 60); + } else { LCONSOLE_WARN("%s: Client %s (at %s) " "reconnecting\n", target->obd_name, obd_uuid2str(&exp->exp_client_uuid), obd_export_nid2str(exp)); + } conn->cookie = exp->exp_handle.h_cookie; /* target_handle_connect() treats EALREADY and @@ -954,15 +957,16 @@ no_export: t = cfs_timer_deadline(&target->obd_recovery_timer); t = cfs_time_sub(t, cfs_time_current()); + t = cfs_duration_sec(t); LCONSOLE_WARN("%s: Denying connection for new client " "%s (at %s), waiting for %d clients in " - "recovery for "CFS_TIME_T"s\n", + "recovery for %d:%.02d\n", target->obd_name, libcfs_nid2str(req->rq_peer.nid), cluuid.uuid, cfs_atomic_read(&target-> \ obd_lock_replay_clients), - cfs_duration_sec(t)); + (int)t / 60, (int)t % 60); rc = -EBUSY; } else { dont_check_exports: -- 1.8.3.1