From 93948cf16241a676f64a956fb88585d8a7413a92 Mon Sep 17 00:00:00 2001 From: adilger Date: Thu, 24 Feb 2005 19:31:08 +0000 Subject: [PATCH] Branch: b1_4 Hold ns lock when calling ldlm_del_waiting_lock() from ldlm_handle_ast_error(). This was detected by Phil's recent addition of "l_check_ns_lock()" therein. b=5746 --- lustre/ChangeLog | 1 + lustre/ldlm/ldlm_lockd.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index a0d38dd..e71df7f 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -24,6 +24,7 @@ tbd Cluster File Systems, Inc. - export a proc file for general "ping" checking (5628) - fix "lfs check" to not block when the MDS is down (5628) - don't LASSERT in ll_release on NULL lld with NFS export (4655, 5760) + - hold NS lock when calling handle_ast_error->del_waiting_lock (5746) * miscellania - service request history (4965) - put {ll,lov,osc}_async_page structs in a single slab (4699) diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index 301b6af..c0331a0 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -349,7 +349,9 @@ static int ldlm_handle_ast_error(struct ldlm_lock *lock, ldlm_lock_cancel(lock); rc = -ERESTART; } else { + l_lock(&lock->l_resource->lr_namespace->ns_lock); ldlm_del_waiting_lock(lock); + l_unlock(&lock->l_resource->lr_namespace->ns_lock); ldlm_failed_ast(lock, rc, ast_type); } } else if (rc) { @@ -768,17 +770,21 @@ int ldlm_handle_convert(struct ptlrpc_request *req) if (!lock) { req->rq_status = EINVAL; } else { + l_lock(&lock->l_resource->lr_namespace->ns_lock); LDLM_DEBUG(lock, "server-side convert handler START"); ldlm_lock_convert(lock, dlm_req->lock_desc.l_req_mode, &dlm_rep->lock_flags); if (ldlm_del_waiting_lock(lock)) CDEBUG(D_DLMTRACE, "converted waiting lock %p\n", lock); + l_unlock(&lock->l_resource->lr_namespace->ns_lock); req->rq_status = 0; } if (lock) { ldlm_reprocess_all(lock->l_resource); + l_lock(&lock->l_resource->lr_namespace->ns_lock); LDLM_DEBUG(lock, "server-side convert handler END"); + l_unlock(&lock->l_resource->lr_namespace->ns_lock); LDLM_LOCK_PUT(lock); } else LDLM_DEBUG_NOLOCK("server-side convert handler END"); -- 1.8.3.1