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

b6df4b79a5
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>
This commit is contained in:
Mike Christie 2017-05-02 23:57:05 -05:00 committed by Nicholas Bellinger
parent 46861cdd80
commit d906d8af28
1 changed files with 3 additions and 0 deletions

View File

@ -1560,6 +1560,9 @@ static int unmap_thread_fn(void *data)
schedule();
finish_wait(&unmap_wait, &__wait);
if (kthread_should_stop())
break;
mutex_lock(&root_udev_mutex);
list_for_each_entry(udev, &root_udev, node) {
mutex_lock(&udev->cmdr_lock);