mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
mm: fix error case in mlock downgrade reversion
Commit 27421e211a, Manually revert
"mlock: downgrade mmap sem while populating mlocked regions", has
introduced its own regression: __mlock_vma_pages_range() may report
an error (for example, -EFAULT from trying to lock down pages from
beyond EOF), but mlock_vma_pages_range() must hide that from its
callers as before.
Reported-by: Sami Farin <[email protected]>
Signed-off-by: Hugh Dickins <[email protected]>
Cc: [email protected]
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
8e4921515c
commit
d5b562330e
1 changed files with 4 additions and 1 deletions
|
|
@ -311,7 +311,10 @@ long mlock_vma_pages_range(struct vm_area_struct *vma,
|
|||
is_vm_hugetlb_page(vma) ||
|
||||
vma == get_gate_vma(current))) {
|
||||
|
||||
return __mlock_vma_pages_range(vma, start, end, 1);
|
||||
__mlock_vma_pages_range(vma, start, end, 1);
|
||||
|
||||
/* Hide errors from mmap() and other callers */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue