Whamcloud - gitweb
- If the DLM server returns ELDLM_LOCK_ABORTED, pass that status up to the
authorpschwan <pschwan>
Sun, 23 Jun 2002 19:13:44 +0000 (19:13 +0000)
committerpschwan <pschwan>
Sun, 23 Jun 2002 19:13:44 +0000 (19:13 +0000)
caller
- If ldlm_cli_enqueue returns ELDLM_LOCK_ABORTED, set it->it_lock_mode to 0 to
avoid doing a decref on a non-existent lock
- Add a couple debugging messages

lustre/ldlm/ldlm_request.c
lustre/llite/dcache.c
lustre/mdc/mdc_request.c

index c98bbd0..709b428 100644 (file)
@@ -82,12 +82,12 @@ int ldlm_cli_enqueue(struct ptlrpc_client *cl, struct ptlrpc_connection *conn,
 
         spin_lock(&lock->l_lock);
         if (rc != ELDLM_OK) {
+                LDLM_DEBUG(lock, "client-side enqueue END (%s)",
+                           rc == ELDLM_LOCK_ABORTED ? "ABORTED" : "FAILED");
                 spin_lock(&lock->l_resource->lr_lock);
                 ldlm_resource_put(lock->l_resource);
                 spin_unlock(&lock->l_resource->lr_lock);
                 ldlm_lock_free(lock);
-                if (rc == ELDLM_LOCK_ABORTED)
-                        rc = 0;
                 GOTO(out, rc);
         }
 
index cbe154b..3a6d230 100644 (file)
@@ -4,8 +4,8 @@
  * This code is issued under the GNU General Public License.
  * See the file COPYING in this distribution
  *
- *  Copyright (C) 2001, Cluster File Systems, Inc.
- * 
+ * Copyright (C) 2001, 2002 Cluster File Systems, Inc.
+ *
  */
 
 #include <linux/fs.h>
@@ -33,8 +33,8 @@ void ll_intent_release(struct dentry *de)
         if (de->d_it->it_lock_mode) {
                 handle = (struct lustre_handle *)de->d_it->it_lock_handle;
                 lock = lustre_handle2object(handle);
-                CDEBUG(D_INFO, "calling ldlm_lock_decref(%p, %d)\n", lock,
-                       de->d_it->it_lock_mode);
+                LDLM_DEBUG(lock, "calling ldlm_lock_decref(%d)",
+                           de->d_it->it_lock_mode);
                 ldlm_lock_decref(lock, de->d_it->it_lock_mode);
         }
         de->d_it = NULL;
@@ -44,12 +44,11 @@ void ll_intent_release(struct dentry *de)
 int ll_revalidate2(struct dentry *de, int flags, struct lookup_intent *it)
 {
         ENTRY;
-        
+
         RETURN(0);
 }
 
-
-struct dentry_operations ll_d_ops = { 
+struct dentry_operations ll_d_ops = {
         d_revalidate2: ll_revalidate2,
         d_intent_release: ll_intent_release
 };
index de7ad89..691a237 100644 (file)
@@ -338,6 +338,9 @@ int mdc_enqueue(struct obd_conn *conn, int lock_type, struct lookup_intent *it,
         if (rc == -ENOENT) {
                 lock_mode = 0;
                 memset(lockh, 0, sizeof(*lockh));
+                it->it_lock_mode = lock_mode;
+        } else if (rc == ELDLM_LOCK_ABORTED) {
+                it->it_lock_mode = 0;
         } else if (rc != 0) {
                 CERROR("ldlm_cli_enqueue: %d\n", rc);
                 RETURN(rc);
@@ -346,7 +349,6 @@ int mdc_enqueue(struct obd_conn *conn, int lock_type, struct lookup_intent *it,
         dlm_rep = lustre_msg_buf(req->rq_repmsg, 0); 
         it->it_disposition = (int) dlm_rep->lock_policy_res1;
         it->it_status = (int) dlm_rep->lock_policy_res2;
-        it->it_lock_mode = lock_mode;
         it->it_data = req;
 
         RETURN(0);