From d9d4fe83c585f588889f1bd00445ac2ac923691d Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 26 Jul 2019 01:26:03 +0000 Subject: [PATCH] scst: Queue tgt_dev free work on system_long_wq scst_free_tgt_dev() waits until pending I/O commands have finished and hence can take a while. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8487 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_lib.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index d5c756ea9..32179653e 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -4584,7 +4584,11 @@ void scst_free_tgt_dev_rcu(struct rcu_head *rcu) tgt_dev->a = scst_get(); percpu_ref_get(&tgt_dev->dev->refcnt); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36) WARN_ON_ONCE(!schedule_work(&tgt_dev->free_work)); +#else + WARN_ON_ONCE(!queue_work(system_long_wq, &tgt_dev->free_work)); +#endif } /* Delete a LUN without generating a unit attention. */