Whamcloud - gitweb
Branch: b1_4
authoradilger <adilger>
Thu, 24 Feb 2005 19:31:08 +0000 (19:31 +0000)
committeradilger <adilger>
Thu, 24 Feb 2005 19:31:08 +0000 (19:31 +0000)
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
lustre/ldlm/ldlm_lockd.c

index a0d38dd..e71df7f 100644 (file)
@@ -24,6 +24,7 @@ tbd         Cluster File Systems, Inc. <info@clusterfs.com>
        - 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)
index 301b6af..c0331a0 100644 (file)
@@ -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");