From: Oleg Drokin Date: Thu, 5 Jun 2014 02:14:11 +0000 (-0400) Subject: LU-4579 ldlm: Properly display time on lock timeout X-Git-Tag: 2.6.0-RC1~87 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=f3864905b26a90ed3a9bb6f99357264fa40015c4;hp=c394068ee148595711c661651368b91373bcc78a LU-4579 ldlm: Properly display time on lock timeout When lock timeout happens, need to printtime since last lock activity, not since when the lock was granted. As such set l_last_activity to current time when sending callbacks too. Change-Id: I31d0de6d9add67865cfcb16af903647f7cb932a0 Signed-off-by: Oleg Drokin Reviewed-on: http://review.whamcloud.com/10601 Tested-by: Jenkins Reviewed-by: Bobi Jam Reviewed-by: Lai Siyao Tested-by: Maloo --- diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index 4215d1a..2d6a60e 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -339,7 +339,7 @@ static void waiting_locks_callback(unsigned long unused) ldlm_lock_to_ns(lock)->ns_timeouts++; LDLM_ERROR(lock, "lock callback timer expired after %lds: " "evicting client at %s ", - cfs_time_current_sec()- lock->l_last_activity, + cfs_time_current_sec() - lock->l_last_activity, libcfs_nid2str( lock->l_export->exp_connection->c_peer.nid)); @@ -862,6 +862,8 @@ int ldlm_server_blocking_ast(struct ldlm_lock *lock, if (AT_OFF) req->rq_timeout = ldlm_get_rq_timeout(); + lock->l_last_activity = cfs_time_current_sec(); + if (lock->l_export && lock->l_export->exp_nid_stats && lock->l_export->exp_nid_stats->nid_ldlm_stats) lprocfs_counter_incr(lock->l_export->exp_nid_stats->nid_ldlm_stats, @@ -954,6 +956,8 @@ int ldlm_server_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data) LDLM_DEBUG(lock, "server preparing completion AST (after %lds wait)", total_enqueue_wait); + lock->l_last_activity = cfs_time_current_sec(); + /* Server-side enqueue wait time estimate, used in __ldlm_add_waiting_lock to set future enqueue timers */ if (total_enqueue_wait < ldlm_get_enq_timeout(lock)) @@ -1070,6 +1074,8 @@ int ldlm_server_glimpse_ast(struct ldlm_lock *lock, void *data) if (AT_OFF) req->rq_timeout = ldlm_get_rq_timeout(); + lock->l_last_activity = cfs_time_current_sec(); + req->rq_interpret_reply = ldlm_cb_interpret; if (lock->l_export && lock->l_export->exp_nid_stats &&