mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
mm: remove write/force parameters from __get_user_pages_unlocked()
This removes the redundant 'write' and 'force' parameters from __get_user_pages_unlocked() to make the use of FOLL_FORCE explicit in callers as use of this flag can result in surprising behaviour (and hence bugs) within the mm subsystem. Signed-off-by: Lorenzo Stoakes <[email protected]> Acked-by: Paolo Bonzini <[email protected]> Reviewed-by: Jan Kara <[email protected]> Acked-by: Michal Hocko <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
859110d749
commit
d4944b0ece
6 changed files with 34 additions and 19 deletions
|
|
@ -84,7 +84,8 @@ static void async_pf_execute(struct work_struct *work)
|
|||
* mm and might be done in another context, so we must
|
||||
* use FOLL_REMOTE.
|
||||
*/
|
||||
__get_user_pages_unlocked(NULL, mm, addr, 1, 1, 0, NULL, FOLL_REMOTE);
|
||||
__get_user_pages_unlocked(NULL, mm, addr, 1, NULL,
|
||||
FOLL_WRITE | FOLL_REMOTE);
|
||||
|
||||
kvm_async_page_present_sync(vcpu, apf);
|
||||
|
||||
|
|
|
|||
|
|
@ -1416,10 +1416,15 @@ static int hva_to_pfn_slow(unsigned long addr, bool *async, bool write_fault,
|
|||
down_read(¤t->mm->mmap_sem);
|
||||
npages = get_user_page_nowait(addr, write_fault, page);
|
||||
up_read(¤t->mm->mmap_sem);
|
||||
} else
|
||||
} else {
|
||||
unsigned int flags = FOLL_TOUCH | FOLL_HWPOISON;
|
||||
|
||||
if (write_fault)
|
||||
flags |= FOLL_WRITE;
|
||||
|
||||
npages = __get_user_pages_unlocked(current, current->mm, addr, 1,
|
||||
write_fault, 0, page,
|
||||
FOLL_TOUCH|FOLL_HWPOISON);
|
||||
page, flags);
|
||||
}
|
||||
if (npages != 1)
|
||||
return npages;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue