Whamcloud - gitweb
LU-2827 ldlm: wrong handling of ldlm resends
[fs/lustre-release.git] / lustre / ldlm / ldlm_lockd.c
index 2d6a60e..307a823 100644 (file)
@@ -1232,7 +1232,10 @@ int ldlm_handle_enqueue0(struct ldlm_namespace *ns,
         }
 #endif
 
-        if (unlikely(flags & LDLM_FL_REPLAY)) {
+       if (unlikely(lustre_msg_get_flags(req->rq_reqmsg) & MSG_RESENT))
+               flags |= LDLM_FL_RESENT;
+
+       if (unlikely(flags & (LDLM_FL_REPLAY | LDLM_FL_RESENT))) {
                 /* Find an existing lock in the per-export lock hash */
                /* In the function below, .hs_keycmp resolves to
                 * ldlm_export_lock_keycmp() */
@@ -1243,7 +1246,9 @@ int ldlm_handle_enqueue0(struct ldlm_namespace *ns,
                         DEBUG_REQ(D_DLMTRACE, req, "found existing lock cookie "
                                   LPX64, lock->l_handle.h_cookie);
                         GOTO(existing_lock, rc = 0);
-                }
+               } else {
+                       flags &= ~LDLM_FL_RESENT;
+               }
         }
 
        /* The lock's callback data might be set in the policy function */
@@ -2596,6 +2601,8 @@ static int ldlm_bl_thread_main(void *arg)
                 if (blwi->blwi_mem_pressure)
                        memory_pressure_set();
 
+               OBD_FAIL_TIMEOUT(OBD_FAIL_LDLM_PAUSE_CANCEL2, 4);
+
                 if (blwi->blwi_count) {
                         int count;
                        /* The special case when we cancel locks in LRU