diff options
author | Mike Christie <mchristi@redhat.com> | 2017-05-03 00:57:05 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2017-05-04 23:01:41 -0400 |
commit | d906d8af28e524bfa62c49cb2315f6ccdb910938 (patch) | |
tree | 4dc3c3e5801ed5d22ba2e7e464136dd5c69ff6d6 | |
parent | 46861cdd80e1a862dc65d10833a1450861fabef7 (diff) |
tcmu: fix module removal due to stuck thread
We need to do a kthread_should_stop to check when kthread_stop has been
called.
This was a regression added in
b6df4b79a5514a9c6c53533436704129ef45bf76
tcmu: Add global data block pool support
so not sure if you wanted to merge it in with that patch or what.
Signed-off-by: Mike Christie <mchristi@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r-- | drivers/target/target_core_user.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index 89b75ce563d8..9045837f748b 100644 --- a/drivers/target/target_core_user.c +++ b/drivers/target/target_core_user.c | |||
@@ -1560,6 +1560,9 @@ static int unmap_thread_fn(void *data) | |||
1560 | schedule(); | 1560 | schedule(); |
1561 | finish_wait(&unmap_wait, &__wait); | 1561 | finish_wait(&unmap_wait, &__wait); |
1562 | 1562 | ||
1563 | if (kthread_should_stop()) | ||
1564 | break; | ||
1565 | |||
1563 | mutex_lock(&root_udev_mutex); | 1566 | mutex_lock(&root_udev_mutex); |
1564 | list_for_each_entry(udev, &root_udev, node) { | 1567 | list_for_each_entry(udev, &root_udev, node) { |
1565 | mutex_lock(&udev->cmdr_lock); | 1568 | mutex_lock(&udev->cmdr_lock); |