From 13c84f1514db1fdeacd361f63737ba86718f36e2 Mon Sep 17 00:00:00 2001 From: pschwan Date: Sun, 23 Jun 2002 19:13:44 +0000 Subject: [PATCH] - If the DLM server returns ELDLM_LOCK_ABORTED, pass that status up to the 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 | 4 ++-- lustre/llite/dcache.c | 13 ++++++------- lustre/mdc/mdc_request.c | 4 +++- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c index c98bbd0..709b428 100644 --- a/lustre/ldlm/ldlm_request.c +++ b/lustre/ldlm/ldlm_request.c @@ -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); } diff --git a/lustre/llite/dcache.c b/lustre/llite/dcache.c index cbe154b..3a6d230 100644 --- a/lustre/llite/dcache.c +++ b/lustre/llite/dcache.c @@ -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 @@ -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 }; diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index de7ad89..691a237 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -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); -- 1.8.3.1