From b1c565d356af5e43d683aee183fde57640cfc98e Mon Sep 17 00:00:00 2001 From: adilger Date: Tue, 10 Feb 2004 00:07:02 +0000 Subject: [PATCH] Fix timeouts when evicting a client with a single lock held (from 1.0.4). b=2642 --- lustre/ChangeLog | 2 ++ lustre/ldlm/ldlm_lockd.c | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 7fb431f..6ae01e8 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -23,6 +23,8 @@ tbd Cluster File Systems, Inc. - fix ia64 OOPS in llog_test (2255) - zero end of page at obdfilter for partial page writes (2648) - don't leave stale dentries around after renames (bug 2428) + - fix timeouts when evicting a client with a single lock held (2642) + - set deadline for the initial HELLO message to drain (2634) 2004-01-27 Cluster File Systems, Inc. * version 1.0.3 diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index 85c98c4..877018a 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -182,6 +182,17 @@ static void waiting_locks_callback(unsigned long unused) wake_up(&expired_lock_thread.elt_waitq); } + /* + * Make sure the timer will fire again if we have any locks + * left. + */ + if (!list_empty(&waiting_locks_list)) { + unsigned long timeout_rounded; + lock = list_entry(waiting_locks_list.next, struct ldlm_lock, + l_pending_chain); + timeout_rounded = round_timeout(lock->l_callback_timeout); + mod_timer(&waiting_locks_timer, timeout_rounded); + } spin_unlock_bh(&waiting_locks_spinlock); } @@ -253,7 +264,11 @@ int ldlm_del_waiting_lock(struct ldlm_lock *lock) round_timeout(next->l_callback_timeout)); } } + + spin_lock_bh(&expired_lock_thread.elt_lock); list_del_init(&lock->l_pending_chain); + spin_unlock_bh(&expired_lock_thread.elt_lock); + spin_unlock_bh(&waiting_locks_spinlock); LDLM_DEBUG(lock, "removed"); return 1; -- 1.8.3.1