Skip to content

Commit

Permalink
tcmu: Fix module removal due to stuck unmap_thread thread again
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Xiubo Li authored and bgly committed Jul 11, 2017
1 parent be95ad4 commit 758026c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/target/target_core_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -1907,7 +1907,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);
Expand Down

0 comments on commit 758026c

Please sign in to comment.