X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fldlm%2Fldlm_request.c;h=684062f980829a14783c41c8145fc2c037cac809;hp=54ecbddede23c75ce22d45ebb59adb02a4381938;hb=0356990876308f811cc6c61c22946a1cd73e5c23;hpb=800e18fc318096e0e552e9cb1927ad99b61d205e;ds=sidebyside diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c index 54ecbdd..684062f 100644 --- a/lustre/ldlm/ldlm_request.c +++ b/lustre/ldlm/ldlm_request.c @@ -1480,6 +1480,12 @@ static ldlm_policy_res_t ldlm_cancel_lrur_policy(struct ldlm_namespace *ns, if (count && added >= count) return LDLM_POLICY_KEEP_LOCK; + /* Despite of the LV, It doesn't make sense to keep the lock which + * is unused for ns_max_age time. */ + if (cfs_time_after(cfs_time_current(), + cfs_time_add(lock->l_last_used, ns->ns_max_age))) + return LDLM_POLICY_CANCEL_LOCK; + slv = ldlm_pool_get_slv(pl); lvf = ldlm_pool_get_lvf(pl); la = cfs_duration_sec(cfs_time_sub(cur,