From 5701b8078bd3e8ac50c975f2b48bbed1ba4a480c Mon Sep 17 00:00:00 2001 From: bobijam Date: Fri, 10 Apr 2009 01:51:30 +0000 Subject: [PATCH] Branch b1_6 b=18638 i=jinshan.xiong (jay) i=andrew.perepachko (panda) ldlm_lock_put() use RCU to call ldlm_lock_free, so need call synchronize_rcu() to wait a grace period elapsed, so that ldlm_lock_free() get a chance to be called. --- lustre/ldlm/ldlm_lockd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index b3c0ad0..9e3c6bb 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -2328,6 +2328,12 @@ void __exit ldlm_exit(void) CERROR("ldlm_refcount is %d in ldlm_exit!\n", ldlm_refcount); rc = cfs_mem_cache_destroy(ldlm_resource_slab); LASSERTF(rc == 0, "couldn't free ldlm resource slab\n"); +#ifdef __KERNEL__ + /* ldlm_lock_put() use RCU to call ldlm_lock_free, so need call + * synchronize_rcu() to wait a grace period elapsed, so that + * ldlm_lock_free() get a chance to be called. */ + synchronize_rcu(); +#endif rc = cfs_mem_cache_destroy(ldlm_lock_slab); LASSERTF(rc == 0, "couldn't free ldlm lock slab\n"); rc = cfs_mem_cache_destroy(ldlm_interval_slab); -- 1.8.3.1