From: adilger Date: Tue, 10 Feb 2004 00:07:02 +0000 (+0000) Subject: Fix timeouts when evicting a client with a single lock held (from 1.0.4). X-Git-Tag: 1.2.0~112 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=b1c565d356af5e43d683aee183fde57640cfc98e;p=fs%2Flustre-release.git Fix timeouts when evicting a client with a single lock held (from 1.0.4). b=2642 --- 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;