From aa1955f486c792c02b81dd1da548114ac69dd4ce Mon Sep 17 00:00:00 2001 From: yury Date: Fri, 7 Nov 2008 21:10:46 +0000 Subject: [PATCH] b=17511 r=johann,adilger - removes deadlock possibility by disabling rehash in hash_del() operations and moving hash_add() out of spin_locks when calling. Hash table has own mechanisms for protecting its structures and it also has hash_add_unique() method for using in concurrent run contexts; - fixed missed lh_put() in hash_add_unique() which led to extra refs in some cases (extra ref to export) and inability to cleanup; - fixed __lustre_hash_set_theta() which set @max theta into ->lh_min_theta; - in lustre_hash_rehash_size() disable rehash also for the case when new and old hash sizes equal in corner cases (max_size or min_size). Before this fix it could be possible to do needless rehashes when size is actually did not change but we do this expensive operation; - disable rehash in hash_add_unique() if no actual add happened since entry with the same key is already found in the table; - some cleanups in hash table code; --- lustre/ldlm/ldlm_lockd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index 56f9959..c6e85b5 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -1024,8 +1024,7 @@ int ldlm_handle_enqueue(struct ptlrpc_request *req, if (lock->l_export->exp_lock_hash) lustre_hash_add(lock->l_export->exp_lock_hash, - &lock->l_remote_handle, - &lock->l_exp_hash); + &lock->l_remote_handle, &lock->l_exp_hash); existing_lock: -- 1.8.3.1