summaryrefslogtreecommitdiffstats
path: root/drivers/target/target_core_user.c
diff options
context:
space:
mode:
authorXiubo Li2017-06-15 09:05:31 +0200
committerNicholas Bellinger2017-07-07 08:11:33 +0200
commit07932a023af3cd728390ffdaeffb78e357123181 (patch)
treec33e79e1a12465f542a8a4496eb603da0ac9b772 /drivers/target/target_core_user.c
parenttarget: Fix COMPARE_AND_WRITE caw_sem leak during se_cmd quiesce (diff)
downloadkernel-qcow2-linux-07932a023af3cd728390ffdaeffb78e357123181.tar.gz
kernel-qcow2-linux-07932a023af3cd728390ffdaeffb78e357123181.tar.xz
kernel-qcow2-linux-07932a023af3cd728390ffdaeffb78e357123181.zip
tcmu: Fix module removal due to stuck unmap_thread thread again
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> Reviewed-by: Mike Christie <mchristi@redhat.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_user.c')
-rw-r--r--drivers/target/target_core_user.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
index afc1fd6bacaf..a60a66d61146 100644
--- a/drivers/target/target_core_user.c
+++ b/drivers/target/target_core_user.c
@@ -1707,7 +1707,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);