lkml.org 
[lkml]   [2020]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH] vfio: type1: fix kthread use case
From
Date

> +++ b/drivers/vfio/vfio_iommu_type1.c

> @@ -2812,11 +2815,10 @@ static int vfio_iommu_type1_dma_rw_chunk

> if (!mm)
> return -EPERM;
>
> - if (kthread)
> + if (kthread && use_mm)

Can another design approach make sense here?

+ bool thread_use_mm = ((current->flags & PF_KTHREAD) && !current->mm);
+ if (thread_use_mm)


> kthread_use_mm(mm);


Regards,
Markus

\
 
 \ /
  Last update: 2020-07-06 16:08    [W:0.024 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site