Whamcloud - gitweb
Branch HEAD
authorbobijam <bobijam>
Tue, 29 Jul 2008 02:18:52 +0000 (02:18 +0000)
committerbobijam <bobijam>
Tue, 29 Jul 2008 02:18:52 +0000 (02:18 +0000)
b=15924
i=johann, green

should check ldlm_lock::l_destroyed with ldlm_resource::lr_lock locked.

lustre/ldlm/ldlm_flock.c

index 737de82..2771a53 100644 (file)
@@ -547,18 +547,19 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, int flags, void *data)
         RETURN(rc);
 
 granted:
+        LDLM_DEBUG(lock, "client-side enqueue granted");
+        ns = lock->l_resource->lr_namespace;
+        lock_res(lock->l_resource);
+
         /* before flock's complete ast gets here, the flock
          * can possibly be freed by another thread
          */
         if (lock->l_destroyed) {
                 LDLM_DEBUG(lock, "already destroyed by another thread");
+                unlock_res(lock->l_resource);
                 RETURN(0);
         }
 
-        LDLM_DEBUG(lock, "client-side enqueue granted");
-        ns = lock->l_resource->lr_namespace;
-        lock_res(lock->l_resource);
-
         /* take lock off the deadlock detection waitq. */
         spin_lock(&ldlm_flock_waitq_lock);
         list_del_init(&lock->l_flock_waitq);