From 87ed98e514c5047ae9628fb692428ea68db73860 Mon Sep 17 00:00:00 2001 From: bobijam Date: Tue, 29 Jul 2008 02:23:25 +0000 Subject: [PATCH] Branch b1_8_gate b=15924 i=joahnn, green should check ldlm_lock::l_destroyed with ldlm_resource::lr_lock locked. --- lustre/ldlm/ldlm_flock.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lustre/ldlm/ldlm_flock.c b/lustre/ldlm/ldlm_flock.c index 6b24da0..c6bdb58 100644 --- a/lustre/ldlm/ldlm_flock.c +++ b/lustre/ldlm/ldlm_flock.c @@ -558,18 +558,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_and_lock(lock); + /* 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_and_lock(lock); RETURN(0); } - LDLM_DEBUG(lock, "client-side enqueue granted"); - ns = lock->l_resource->lr_namespace; - lock_res_and_lock(lock); - /* take lock off the deadlock detection waitq. */ spin_lock(&ldlm_flock_waitq_lock); list_del_init(&lock->l_flock_waitq); -- 1.8.3.1