Whamcloud - gitweb
Branch: b1_4
authoradilger <adilger>
Sun, 6 Mar 2005 07:26:19 +0000 (07:26 +0000)
committeradilger <adilger>
Sun, 6 Mar 2005 07:26:19 +0000 (07:26 +0000)
- don't move pending lock onto export if it is already evicted
b=5863
r=phil

lustre/ChangeLog
lustre/ldlm/ldlm_lockd.c

index d1f69e2..2246c1c 100644 (file)
@@ -34,6 +34,7 @@ tbd         Cluster File Systems, Inc. <info@clusterfs.com>
        - fix DLM error path that led to out-of-sync client, long delays (5779)
        - support common vfs-enforced mount options (nodev,nosuid,noexec) (5637)
        - fix several locking issues related to i_size (5492,5624,5654,5672)
+       - don't move pending lock onto export if it is already evicted (5683)
        * miscellania
        - service request history (4965)
        - put {ll,lov,osc}_async_page structs in a single slab (4699)
index 8fd2e79..ec30586 100644 (file)
@@ -639,6 +639,8 @@ int ldlm_handle_enqueue(struct ptlrpc_request *req,
 
         OBD_FAIL_TIMEOUT(OBD_FAIL_LDLM_ENQUEUE_BLOCKED, obd_timeout * 2);
         l_lock(&lock->l_resource->lr_namespace->ns_lock);
+        /* Don't enqueue a lock onto the export if it has already
+         * been evicted.  Cancel it now instead. (bug 3822) */
         if (req->rq_export->exp_failed) {
                 LDLM_ERROR(lock, "lock on destroyed export %p", req->rq_export);
                 l_unlock(&lock->l_resource->lr_namespace->ns_lock);
@@ -693,7 +695,12 @@ existing_lock:
         /* We never send a blocking AST until the lock is granted, but
          * we can tell it right now */
         l_lock(&lock->l_resource->lr_namespace->ns_lock);
-        if (lock->l_flags & LDLM_FL_AST_SENT) {
+        /* Don't move a pending lock onto the export if it has already
+         * been evicted.  Cancel it now instead. (bug 5683) */
+        if (req->rq_export->exp_failed) {
+                LDLM_ERROR(lock, "lock on destroyed export %p", req->rq_export);
+                rc = -ENOTCONN;
+        } else if (lock->l_flags & LDLM_FL_AST_SENT) {
                 dlm_rep->lock_flags |= LDLM_FL_AST_SENT;
                 if (lock->l_granted_mode == lock->l_req_mode)
                         ldlm_add_waiting_lock(lock);