Whamcloud - gitweb
LU-7860 ldlm: revert part of commit 657bbc49
[fs/lustre-release.git] / lustre / ldlm / ldlm_lock.c
index e973edc..10f8e8f 100644 (file)
@@ -2273,7 +2273,10 @@ void ldlm_lock_cancel(struct ldlm_lock *lock)
         /* Releases cancel callback. */
         ldlm_cancel_callback(lock);
 
-       LASSERT(!ldlm_is_waited(lock));
+       /* Yes, second time, just in case it was added again while we were
+        * running with no res lock in ldlm_cancel_callback */
+       if (ldlm_is_waited(lock))
+               ldlm_del_waiting_lock(lock);
 
         ldlm_resource_unlink_lock(lock);
         ldlm_lock_destroy_nolock(lock);