From: Niu Yawei Date: Tue, 28 Oct 2014 02:20:07 +0000 (-0400) Subject: LU-5727 ldlm: revert changes to ldlm_cancel_aged_policy() X-Git-Tag: 2.6.90~62 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=e8812867e8c6c9eb62174b370cb818985e3d2180 LU-5727 ldlm: revert changes to ldlm_cancel_aged_policy() The changes to ldlm_cancel_aged_policy() intrdouced from LU-4300 (bfae5a) was incorrect. This patch revert this part of changes. Signed-off-by: Niu Yawei Change-Id: Ic04f894c8bf54dbbdfb0e3bada5f6e4a367711a5 Reviewed-on: http://review.whamcloud.com/12448 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Bobi Jam Reviewed-by: Jinshan Xiong Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c index 3c1a0a8..533f18c 100644 --- a/lustre/ldlm/ldlm_request.c +++ b/lustre/ldlm/ldlm_request.c @@ -1529,15 +1529,13 @@ static ldlm_policy_res_t ldlm_cancel_aged_policy(struct ldlm_namespace *ns, int unused, int added, int count) { - if (added >= count) - return LDLM_POLICY_KEEP_LOCK; - - if (cfs_time_before(cfs_time_current(), + if ((added >= count) && + cfs_time_before(cfs_time_current(), cfs_time_add(lock->l_last_used, ns->ns_max_age))) - return LDLM_POLICY_KEEP_LOCK; + return LDLM_POLICY_KEEP_LOCK; - if (ns->ns_cancel != NULL && ns->ns_cancel(lock) == 0) - return LDLM_POLICY_KEEP_LOCK; + if (ns->ns_cancel != NULL && ns->ns_cancel(lock) == 0) + return LDLM_POLICY_KEEP_LOCK; return LDLM_POLICY_CANCEL_LOCK; }