From 890dcd1aae57ba48487a72810ea19a43937bee67 Mon Sep 17 00:00:00 2001 From: adilger Date: Sun, 6 Mar 2005 07:26:19 +0000 Subject: [PATCH] Branch: b1_4 - don't move pending lock onto export if it is already evicted b=5863 r=phil --- lustre/ChangeLog | 1 + lustre/ldlm/ldlm_lockd.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index d1f69e2..2246c1c 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -34,6 +34,7 @@ tbd Cluster File Systems, Inc. - 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) diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index 8fd2e79..ec30586 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -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); -- 1.8.3.1