Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 107551
b: refs/heads/master
c: a477097
h: refs/heads/master
i:
  107549: 2ecab9a
  107547: b775822
  107543: 7aceb9a
  107535: ab13dc5
  107519: 6a6a436
v: v3
  • Loading branch information
KOSAKI Motohiro authored and Linus Torvalds committed Aug 4, 2008
1 parent 323c0b2 commit 8260790
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dc329442b9fd365bec95718013586c07ff600c34
refs/heads/master: a477097d9c37c1cf289c7f0257dffcfa42d50197
16 changes: 13 additions & 3 deletions trunk/mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -2765,16 +2765,26 @@ int make_pages_present(unsigned long addr, unsigned long end)

vma = find_vma(current->mm, addr);
if (!vma)
return -1;
return -ENOMEM;
write = (vma->vm_flags & VM_WRITE) != 0;
BUG_ON(addr >= end);
BUG_ON(end > vma->vm_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)
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;
return ret;
return ret == len ? 0 : -1;
}
return ret == len ? 0 : -ENOMEM;
}

#if !defined(__HAVE_ARCH_GATE_AREA)
Expand Down
2 changes: 0 additions & 2 deletions trunk/mm/mlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ static int mlock_fixup(struct vm_area_struct *vma, struct vm_area_struct **prev,

mm->locked_vm -= pages;
out:
if (ret == -ENOMEM)
ret = -EAGAIN;
return ret;
}

Expand Down

0 comments on commit 8260790

Please sign in to comment.