From: Oleg Drokin Date: Mon, 6 Jul 2015 16:48:41 +0000 (-0400) Subject: staging/lustre/ldlm: In ldlm_pools_fini make sure there was init first. X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=faa7a4e3e03889267f66a98d85434b4ff7dd0087;p=openwrt%2Fstaging%2Fblogic.git staging/lustre/ldlm: In ldlm_pools_fini make sure there was init first. It turns out if you call ldlm_pools_fini without completing the ldlm_pools_init, then attempt to unregister not yet registered shrinkers makes the kernel very unhappy. So make sure we have them registered first. Signed-off-by: Oleg Drokin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c index 4519d779a0ef..c234acb85f10 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c @@ -1486,8 +1486,10 @@ EXPORT_SYMBOL(ldlm_pools_init); void ldlm_pools_fini(void) { - unregister_shrinker(&ldlm_pools_srv_shrinker); - unregister_shrinker(&ldlm_pools_cli_shrinker); + if (ldlm_pools_thread) { + unregister_shrinker(&ldlm_pools_srv_shrinker); + unregister_shrinker(&ldlm_pools_cli_shrinker); + } ldlm_pools_thread_stop(); } EXPORT_SYMBOL(ldlm_pools_fini);