Commit 24e3b539 authored by Oleg Drokin's avatar Oleg Drokin
Browse files

LU-13692 ldlm: Ensure we reprocess the resource on ast error

When we are trying to grant a lock and met an AST error, rerunning
the policy is pointless since it cannot grant a potentially now eligible
lock and our lock is already in all the queues, just be like all the other
handlers for ERESTART return and run a full resource reprocess instead.

Change-Id: I3edb37bf084b2e26ba03cf2079d3358779c84b6e
Signed-off-by: default avatarOleg Drokin <>

Tested-by: default avatarjenkins <>
Tested-by: default avatarMaloo <>
Reviewed-by: default avatarAndreas Dilger <>
Reviewed-by: default avatarYingjin Qian <>
parent 5da99051
......@@ -1723,14 +1723,10 @@ static enum ldlm_error ldlm_lock_enqueue_helper(struct ldlm_lock *lock,
policy = ldlm_get_processing_policy(res);
policy(lock, flags, LDLM_PROCESS_ENQUEUE, &rc, &rpc_list);
if (rc == ELDLM_OK && lock->l_granted_mode != lock->l_req_mode &&
res->lr_type != LDLM_FLOCK) {
res->lr_type != LDLM_FLOCK)
rc = ldlm_handle_conflict_lock(lock, flags, &rpc_list);
if (rc == -ERESTART)
GOTO(restart, rc);
if (!list_empty(&rpc_list))
......@@ -2034,6 +2030,9 @@ int ldlm_handle_conflict_lock(struct ldlm_lock *lock, __u64 *flags,
if (rc == -ERESTART)
ldlm_reprocess_all(res, NULL);
if (rc == -ERESTART) {
/* 15715: The lock was granted and destroyed after
......@@ -2053,10 +2052,8 @@ int ldlm_handle_conflict_lock(struct ldlm_lock *lock, __u64 *flags,
* freed. Then we will fail at
* ldlm_extent_add_lock() */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment