From: pschwan Date: Fri, 21 Jun 2002 20:04:44 +0000 (+0000) Subject: Fix for cleanup deadlock X-Git-Tag: 0.4.2~92 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=dff7d70d24d49758dba45f7d9dea6238bc39b9f0;p=fs%2Flustre-release.git Fix for cleanup deadlock --- diff --git a/lustre/ldlm/ldlm_resource.c b/lustre/ldlm/ldlm_resource.c index 39f2720..7d09521 100644 --- a/lustre/ldlm/ldlm_resource.c +++ b/lustre/ldlm/ldlm_resource.c @@ -73,6 +73,7 @@ static int cleanup_resource(struct ldlm_resource *res, struct list_head *q) lock = list_entry(tmp, struct ldlm_lock, l_res_link); if (client) { + spin_unlock(&res->lr_lock); rc = ldlm_cli_cancel(lock->l_client, lock); if (rc < 0) { CERROR("ldlm_cli_cancel: %d\n", rc); @@ -80,6 +81,8 @@ static int cleanup_resource(struct ldlm_resource *res, struct list_head *q) } if (rc == ELDLM_RESOURCE_FREED) rc = 1; + else + spin_lock(&res->lr_lock); } else { CERROR("Freeing a lock still held by a client node.\n");