diff options
author | Hugh Dickins <hugh@veritas.com> | 2009-02-08 15:56:58 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-02-08 16:53:28 -0500 |
commit | d5b562330ec766292a3ac54ae5e0673610bd5b3d (patch) | |
tree | a0e10b64c1f7264efd073bbb0d93011c2064730f /mm | |
parent | 8e4921515c1a379539607eb443d51c30f4f7f338 (diff) |
mm: fix error case in mlock downgrade reversion
Commit 27421e211a39784694b597dbf35848b88363c248, 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 <safari-kernel@safari.iki.fi>
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/mlock.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/mlock.c b/mm/mlock.c index 028ec482fdd4..037161d61b4e 100644 --- a/mm/mlock.c +++ b/mm/mlock.c | |||
@@ -311,7 +311,10 @@ long mlock_vma_pages_range(struct vm_area_struct *vma, | |||
311 | is_vm_hugetlb_page(vma) || | 311 | is_vm_hugetlb_page(vma) || |
312 | vma == get_gate_vma(current))) { | 312 | vma == get_gate_vma(current))) { |
313 | 313 | ||
314 | return __mlock_vma_pages_range(vma, start, end, 1); | 314 | __mlock_vma_pages_range(vma, start, end, 1); |
315 | |||
316 | /* Hide errors from mmap() and other callers */ | ||
317 | return 0; | ||
315 | } | 318 | } |
316 | 319 | ||
317 | /* | 320 | /* |