struct ldlm_reply *rep;
ldlm_error_t err;
int idx, rc, only_liblustre = 1;
- __u64 tmpflags = 0;
struct ldlm_interval_tree *tree;
struct ofd_intent_args arg;
__u32 repsize[3] = {
LASSERT(ns == ldlm_res_to_ns(res));
lock_res(res);
- rc = policy(lock, &tmpflags, 0, &err, NULL);
- check_res_locked(res);
+
+ /* Check if this is a resend case (MSG_RESENT is set on RPC) and a
+ * lock was found by ldlm_handle_enqueue(); if so no need to grant
+ * it again. */
+ if (flags & LDLM_FL_RESENT) {
+ rc = LDLM_ITER_CONTINUE;
+ } else {
+ __u64 tmpflags = 0;
+ rc = policy(lock, &tmpflags, 0, &err, NULL);
+ check_res_locked(res);
+ }
/* The lock met with no resistance; we're finished. */
if (rc == LDLM_ITER_CONTINUE) {