diff options
author | Lee Schermerhorn <lee.schermerhorn@hp.com> | 2008-10-18 20:26:56 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-20 08:52:31 -0700 |
commit | c11d69d8c830e09a0e7b3935c952afb26c48bba8 (patch) | |
tree | c419910614bf29a77b3491014e13a7089093993a /mm/memory.c | |
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>
Diffstat (limited to 'mm/memory.c')
-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 450127f4c58..b8487f8cd82 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -2819,19 +2819,9 @@ int make_pages_present(unsigned long addr, unsigned long end) len = DIV_ROUND_UP(end, PAGE_SIZE) - addr/PAGE_SIZE; ret = get_user_pages(current, current->mm, addr, len, write, 0, NULL, NULL); - if (ret < 0) { - /* - SUS require strange return value to mlock - - invalid addr generate to ENOMEM. - - out of memory should generate EAGAIN. - */ - if (ret == -EFAULT) - ret = -ENOMEM; - else if (ret == -ENOMEM) - ret = -EAGAIN; + if (ret < 0) return ret; - } - return ret == len ? 0 : -ENOMEM; + return ret == len ? 0 : -1; } #if !defined(__HAVE_ARCH_GATE_AREA) |