diff options
author | Lee Schermerhorn <lee.schermerhorn@hp.com> | 2008-10-18 23:26:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-20 11:52:31 -0400 |
commit | c11d69d8c830e09a0e7b3935c952afb26c48bba8 (patch) | |
tree | c419910614bf29a77b3491014e13a7089093993a | |
parent | e0f79b8f1f3394bb344b7b83d6f121ac2af327de (diff) |
mlock: revert mainline handling of mlock error return
This change is intended to make mlock() error returns correct.
make_page_present() is a lower level function used by more than mlock().
Subsequent patch[es] will add this error return fixup in an mlock specific
path.
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | mm/memory.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/mm/memory.c b/mm/memory.c index 450127f4c582..b8487f8cd82e 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -2819,19 +2819,9 @@ int make_pages_present(unsigned long addr, unsigned long end) | |||
2819 | len = DIV_ROUND_UP(end, PAGE_SIZE) - addr/PAGE_SIZE; | 2819 | len = DIV_ROUND_UP(end, PAGE_SIZE) - addr/PAGE_SIZE; |
2820 | ret = get_user_pages(current, current->mm, addr, | 2820 | ret = get_user_pages(current, current->mm, addr, |
2821 | len, write, 0, NULL, NULL); | 2821 | len, write, 0, NULL, NULL); |
2822 | if (ret < 0) { | 2822 | if (ret < 0) |
2823 | /* | ||
2824 | SUS require strange return value to mlock | ||
2825 | - invalid addr generate to ENOMEM. | ||
2826 | - out of memory should generate EAGAIN. | ||
2827 | */ | ||
2828 | if (ret == -EFAULT) | ||
2829 | ret = -ENOMEM; | ||
2830 | else if (ret == -ENOMEM) | ||
2831 | ret = -EAGAIN; | ||
2832 | return ret; | 2823 | return ret; |
2833 | } | 2824 | return ret == len ? 0 : -1; |
2834 | return ret == len ? 0 : -ENOMEM; | ||
2835 | } | 2825 | } |
2836 | 2826 | ||
2837 | #if !defined(__HAVE_ARCH_GATE_AREA) | 2827 | #if !defined(__HAVE_ARCH_GATE_AREA) |