From: Minh Diep Date: Wed, 19 Sep 2012 17:50:11 +0000 (-0700) Subject: LU-1095 debug: conditionally print recovery status X-Git-Tag: 2.3.52~14 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=5524d35a064f874b16b7f06cd5362ff74926d644 LU-1095 debug: conditionally print recovery status Avoid printing non-sense messages like this when the recovery code hasn't run. For example, this can occur when your starting a new target for the first time. Lustre: lustre-OST0001: Recovery over after 22277843:04, of 0 clients 0 recovered and 0 were evicted. Signed-off-by: Minh Diep Change-Id: Ib4bd8783c0c17aa15052fc9b9cf78e18274b2783 Reviewed-on: http://review.whamcloud.com/4043 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Keith Mannthey --- diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 288003c..54780a7 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -1376,17 +1376,20 @@ static void target_exp_dequeue_req_replay(struct ptlrpc_request *req) #ifdef __KERNEL__ static void target_finish_recovery(struct obd_device *obd) { - time_t elapsed_time = max_t(time_t, 1, cfs_time_current_sec() - - obd->obd_recovery_start); ENTRY; - LCONSOLE_INFO("%s: Recovery over after %d:%.02d, of %d clients " - "%d recovered and %d %s evicted.\n", obd->obd_name, - (int)elapsed_time / 60, (int)elapsed_time % 60, - obd->obd_max_recoverable_clients, - cfs_atomic_read(&obd->obd_connected_clients), - obd->obd_stale_clients, - obd->obd_stale_clients == 1 ? "was" : "were"); + /* only log a recovery message when recovery has occurred */ + if (obd->obd_recovery_start) { + time_t elapsed_time = max_t(time_t, 1, cfs_time_current_sec() - + obd->obd_recovery_start); + LCONSOLE_INFO("%s: Recovery over after %d:%.02d, of %d clients " + "%d recovered and %d %s evicted.\n", obd->obd_name, + (int)elapsed_time / 60, (int)elapsed_time % 60, + obd->obd_max_recoverable_clients, + cfs_atomic_read(&obd->obd_connected_clients), + obd->obd_stale_clients, + obd->obd_stale_clients == 1 ? "was" : "were"); + } ldlm_reprocess_all_ns(obd->obd_namespace); cfs_spin_lock(&obd->obd_recovery_task_lock);