Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754810AbbGFQtX (ORCPT ); Mon, 6 Jul 2015 12:49:23 -0400 Received: from linuxhacker.ru ([217.76.32.60]:53197 "EHLO fiona.linuxhacker.ru" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1753527AbbGFQtR (ORCPT ); Mon, 6 Jul 2015 12:49:17 -0400 From: green@linuxhacker.ru To: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Andreas Dilger Cc: Linux Kernel Mailing List , Oleg Drokin Subject: [PATCH 03/20] staging/lustre/ldlm: In ldlm_pools_fini make sure there was init first. Date: Mon, 6 Jul 2015 12:48:41 -0400 Message-Id: <1436201338-14263-4-git-send-email-green@linuxhacker.ru> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1436201338-14263-1-git-send-email-green@linuxhacker.ru> References: <1436201338-14263-1-git-send-email-green@linuxhacker.ru> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1300 Lines: 37 From: Oleg Drokin 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 --- drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c index 1605b9c..251efb7 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); -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/