diff options
author | Xiubo Li <lixiubo@cmss.chinamobile.com> | 2017-06-15 09:05:31 +0200 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2017-07-07 08:11:33 +0200 |
commit | 07932a023af3cd728390ffdaeffb78e357123181 (patch) | |
tree | c33e79e1a12465f542a8a4496eb603da0ac9b772 /drivers | |
parent | target: Fix COMPARE_AND_WRITE caw_sem leak during se_cmd quiesce (diff) | |
download | linux-07932a023af3cd728390ffdaeffb78e357123181.tar.xz 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')
-rw-r--r-- | drivers/target/target_core_user.c | 2 |
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); |