On 06/15/2017 02:05 AM, [email protected] wrote:
> From: Xiubo Li <[email protected]>
> 
> 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 <[email protected]>
> ---
>  drivers/target/target_core_user.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/target/target_core_user.c 
> b/drivers/target/target_core_user.c
> index beb5f09..203bff1 100644
> --- a/drivers/target/target_core_user.c
> +++ b/drivers/target/target_core_user.c
> @@ -1573,7 +1573,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);
> 

Looks ok to me

Reviewed-by: Mike Christie <[email protected]>

Reply via email to