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: Oleg Drokin <green@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/39598
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Yingjin Qian <qian@ddn.com>
ENTRY;
policy = ldlm_get_processing_policy(res);
ENTRY;
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 &&
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);
rc = ldlm_handle_conflict_lock(lock, flags, &rpc_list);
- if (rc == -ERESTART)
- GOTO(restart, rc);
- }
if (!list_empty(&rpc_list))
ldlm_discard_bl_list(&rpc_list);
if (!list_empty(&rpc_list))
ldlm_discard_bl_list(&rpc_list);
!ns_is_client(ldlm_res_to_ns(res)))
class_fail_export(lock->l_export);
!ns_is_client(ldlm_res_to_ns(res)))
class_fail_export(lock->l_export);
+ if (rc == -ERESTART)
+ ldlm_reprocess_all(res, NULL);
+
lock_res(res);
if (rc == -ERESTART) {
/* 15715: The lock was granted and destroyed after
lock_res(res);
if (rc == -ERESTART) {
/* 15715: The lock was granted and destroyed after
* freed. Then we will fail at
* ldlm_extent_add_lock() */
*flags &= ~LDLM_FL_BLOCKED_MASK;
* freed. Then we will fail at
* ldlm_extent_add_lock() */
*flags &= ~LDLM_FL_BLOCKED_MASK;
}
*flags |= LDLM_FL_BLOCK_GRANTED;
}
*flags |= LDLM_FL_BLOCK_GRANTED;