From c66294d36fadca3c41cbbeaca528c0044576cd4f Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 10 Oct 2013 03:17:57 +0000 Subject: [PATCH] Avoid that unloading SCST hangs when using bcache Although it seems to be bcache problem, remove the flush_scheduled_work() call because it is not necessary. Call cancel_delayed_work_sync() after unregistration from sysfs just in case a sysfs attribute would ever be added that allows to trigger pool purging directly. Signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5052 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_mem.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scst/src/scst_mem.c b/scst/src/scst_mem.c index b29e9af7a..d5a67d2eb 100644 --- a/scst/src/scst_mem.c +++ b/scst/src/scst_mem.c @@ -1553,8 +1553,6 @@ static void sgv_pool_destroy(struct sgv_pool *pool) TRACE_ENTRY(); - cancel_delayed_work_sync(&pool->sgv_purge_work); - sgv_pool_flush(pool); mutex_lock(&sgv_pools_mutex); @@ -1567,6 +1565,8 @@ static void sgv_pool_destroy(struct sgv_pool *pool) scst_sgv_sysfs_del(pool); #endif + cancel_delayed_work_sync(&pool->sgv_purge_work); + for (i = 0; i < pool->max_caches; i++) { if (pool->caches[i]) kmem_cache_destroy(pool->caches[i]); @@ -1797,8 +1797,6 @@ void scst_sgv_pools_deinit(void) sgv_pool_destroy(sgv_norm_pool); sgv_pool_destroy(sgv_norm_clust_pool); - flush_scheduled_work(); - kmem_cache_destroy(sgv_pool_cachep); TRACE_EXIT();