lkml.org 
[lkml]   [2019]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM
From
Date
On 11/13/19 11:17 AM, Ira Weiny wrote:
...
>>> @@ -348,33 +347,13 @@ static int vaddr_get_pfn(struct mm_struct *mm, unsigned long vaddr,
>>> flags |= FOLL_WRITE;
>>>
>>> down_read(&mm->mmap_sem);
>>> - if (mm == current->mm) {
>>> - ret = get_user_pages(vaddr, 1, flags | FOLL_LONGTERM, page,
>>> - vmas);
>>> - } else {
>>> - ret = get_user_pages_remote(NULL, mm, vaddr, 1, flags, page,
>>> - vmas, NULL);
>>> - /*
>>> - * The lifetime of a vaddr_get_pfn() page pin is
>>> - * userspace-controlled. In the fs-dax case this could
>>> - * lead to indefinite stalls in filesystem operations.
>>> - * Disallow attempts to pin fs-dax pages via this
>>> - * interface.
>>> - */
>>> - if (ret > 0 && vma_is_fsdax(vmas[0])) {
>>> - ret = -EOPNOTSUPP;
>>> - put_page(page[0]);
>>> - }
>>> - }
>>> - up_read(&mm->mmap_sem);
>>> -
>>> + ret = get_user_pages_remote(NULL, mm, vaddr, 1, flags | FOLL_LONGTERM,
>>> + page, NULL, NULL);
>>> if (ret == 1) {
>>> *pfn = page_to_pfn(page[0]);
>>> return 0;
>>
>> Mind the return with the lock held this needs some goto unwind
>
> Ah yea... retract my reviewed by... :-(
>

ooops, embarrassed that I missed that, good catch. Will repost with it fixed.



thanks,
--
John Hubbard
NVIDIA

\
 
 \ /
  Last update: 2019-11-13 21:23    [W:0.080 / U:1.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site