linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tcmu: Fix module removal due to stuck unmap_thread thread again
@ 2017-06-15  7:05 lixiubo
  2017-06-15 19:00 ` Mike Christie
  2017-06-25 19:38 ` Nicholas A. Bellinger
  0 siblings, 2 replies; 3+ messages in thread
From: lixiubo @ 2017-06-15  7:05 UTC (permalink / raw)
  To: nab, mchristi; +Cc: linux-scsi, target-devel, Xiubo Li

From: Xiubo Li <lixiubo@cmss.chinamobile.com>

Because the unmap code just after the schdule() returned may take
a long time and if the kthread_stop() is fired just when in this
routine, the module removal maybe stuck too.

Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com>
---
 drivers/target/target_core_user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
index beb5f09..203bff1 100644
--- a/drivers/target/target_core_user.c
+++ b/drivers/target/target_core_user.c
@@ -1573,7 +1573,7 @@ static int unmap_thread_fn(void *data)
 	struct page *page;
 	int i;
 
-	while (1) {
+	while (!kthread_should_stop()) {
 		DEFINE_WAIT(__wait);
 
 		prepare_to_wait(&unmap_wait, &__wait, TASK_INTERRUPTIBLE);
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-25 19:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-15  7:05 [PATCH] tcmu: Fix module removal due to stuck unmap_thread thread again lixiubo
2017-06-15 19:00 ` Mike Christie
2017-06-25 19:38 ` Nicholas A. Bellinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).