aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-05-14 05:41:41 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-05-14 05:41:41 -0700
commite46bdb8d9a7c3d3d70ec20a9a1057f29efd03f31 (patch)
treef110a5f21f06088c6365a23d52ef1aeb746e6aa3 /mm
parent64525acc0e653d8295edcaa4332b79512483d92b (diff)
downloadhistory-e46bdb8d9a7c3d3d70ec20a9a1057f29efd03f31.tar.gz
[PATCH] VM accounting fix
From: Hugh Dickins <hugh@veritas.com> Stas Sergeev <stsp@aknet.ru> wrote: mprotect() fails to merge VMAs because one VMA can end up with VM_ACCOUNT flag set, and another without that flag. That makes several apps of mine to malfuncate. Great find! Someone has got their test the wrong way round. Since that VM_MAYACCT macro is being used in one place only, and just hiding what it's actually about, fold it into its callsite.
Diffstat (limited to 'mm')
-rw-r--r--mm/mprotect.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/mprotect.c b/mm/mprotect.c
index f4018549f9ed89..dcc9418d9f4e39 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -174,8 +174,7 @@ mprotect_fixup(struct vm_area_struct *vma, struct vm_area_struct **pprev,
* a MAP_NORESERVE private mapping to writable will now reserve.
*/
if (newflags & VM_WRITE) {
- if (!(vma->vm_flags & (VM_ACCOUNT|VM_WRITE|VM_SHARED))
- && VM_MAYACCT(vma)) {
+ if (!(vma->vm_flags & (VM_ACCOUNT|VM_WRITE|VM_SHARED|VM_HUGETLB))) {
charged = (end - start) >> PAGE_SHIFT;
if (security_vm_enough_memory(charged))
return -ENOMEM;