From 12d8c0b320ba5f449622a1685d12d1cb68586f22 Mon Sep 17 00:00:00 2001 From: shaver Date: Wed, 25 Sep 2002 19:43:33 +0000 Subject: [PATCH] - Remove cancelled locks from the waiting list. Revoking locks from a dead client to service another client now seems to work quite well. (The dead client can even reconnect successfully.) --- lustre/include/linux/lustre_dlm.h | 1 + lustre/ldlm/ldlm_lock.c | 1 + lustre/ldlm/ldlm_lockd.c | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lustre/include/linux/lustre_dlm.h b/lustre/include/linux/lustre_dlm.h index 8fb5e3e..874dcc1 100644 --- a/lustre/include/linux/lustre_dlm.h +++ b/lustre/include/linux/lustre_dlm.h @@ -255,6 +255,7 @@ int ldlm_extent_policy(struct ldlm_lock *, void *, ldlm_mode_t, void *); int ldlm_handle_enqueue(struct ptlrpc_request *req); int ldlm_handle_convert(struct ptlrpc_request *req); int ldlm_handle_cancel(struct ptlrpc_request *req); +int ldlm_del_waiting_lock(struct ldlm_lock *lock); /* ldlm_lock.c */ void ldlm_register_intent(int (*arg)(struct ldlm_lock *lock, void *req_cookie, diff --git a/lustre/ldlm/ldlm_lock.c b/lustre/ldlm/ldlm_lock.c index 27c6c6f..17eb2833 100644 --- a/lustre/ldlm/ldlm_lock.c +++ b/lustre/ldlm/ldlm_lock.c @@ -807,6 +807,7 @@ void ldlm_lock_cancel(struct ldlm_lock *lock) ldlm_cancel_callback(lock); + ldlm_del_waiting_lock(lock); ldlm_resource_unlink_lock(lock); ldlm_lock_destroy(lock); l_unlock(&ns->ns_lock); diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index 4166887..5e278c8 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -94,7 +94,7 @@ static int ldlm_add_waiting_lock(struct ldlm_lock *lock) * callback arrive without incident. This adjusts the lock-timeout timer if * needed. Returns 0 if the lock wasn't pending after all, 1 if it was. */ -static int ldlm_del_waiting_lock(struct ldlm_lock *lock) +int ldlm_del_waiting_lock(struct ldlm_lock *lock) { struct list_head *list_next; -- 1.8.3.1