@@ -1204,10 +1204,10 @@ void ldlm_exit(void)
kmem_cache_destroy(ldlm_resource_slab);
/*
* 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.
+ * rcu_barrier() to wait all outstanding RCU callbacks to complete,
+ * so that ldlm_lock_free() get a chance to be called.
*/
- synchronize_rcu();
+ rcu_barrier();
kmem_cache_destroy(ldlm_lock_slab);
kmem_cache_destroy(ldlm_interval_tree_slab);
}
@@ -271,6 +271,11 @@ static void __exit lustre_exit(void)
cl_env_put(cl_inode_fini_env, &cl_inode_fini_refcheck);
vvp_global_fini();
+ /*
+ * Make sure all delayed rcu free inodes are flushed before we
+ * destroy cache.
+ */
+ rcu_barrier();
kmem_cache_destroy(ll_inode_cachep);
kmem_cache_destroy(ll_file_data_slab);
}