From 5c47e8a57e8fddda54936041664a46b79237f604 Mon Sep 17 00:00:00 2001 From: phil Date: Thu, 4 Dec 2003 04:41:32 +0000 Subject: [PATCH] b=2328 r=shaver - Make sure that all locks which have been marked as receiving a blocking AST are eventually added to the waiting list, to evict badly-behaving clients. - If a service node times out waiting for a lock, dump the namespace to the log, no more than once every 5 minutes --- lustre/ldlm/ldlm_lockd.c | 5 ++++- lustre/ldlm/ldlm_request.c | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index 30a0b1f..9fcdfa8 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -555,8 +555,11 @@ int ldlm_handle_enqueue(struct ptlrpc_request *req, /* 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) + 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); + } l_unlock(&lock->l_resource->lr_namespace->ns_lock); EXIT; diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c index 7b6f50d..a7c8050 100644 --- a/lustre/ldlm/ldlm_request.c +++ b/lustre/ldlm/ldlm_request.c @@ -42,6 +42,7 @@ struct lock_wait_data { int ldlm_expired_completion_wait(void *data) { + static unsigned long next_dump = 0; struct lock_wait_data *lwd = data; struct ldlm_lock *lock = lwd->lwd_lock; struct obd_import *imp; @@ -59,6 +60,10 @@ int ldlm_expired_completion_wait(void *data) LDLM_ERROR(lock, "lock timed out, entering recovery for %s@%s", imp->imp_target_uuid.uuid, imp->imp_connection->c_remote_uuid.uuid); + if (time_after(jiffies, next_dump)) { + next_dump = jiffies + 300 * HZ; + ldlm_namespace_dump(lock->l_resource->lr_namespace); + } RETURN(0); } -- 1.8.3.1