aboutsummaryrefslogtreecommitdiff
path: root/mm/mprotect.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-02-13 13:05:57 +0100
committerIngo Molnar <mingo@elte.hu>2009-02-13 13:05:57 +0100
commitd040c1614c24162adc3fe106b182596999264e26 (patch)
tree5af02052e633bcde0e33f77cac52ab4685ad07f1 /mm/mprotect.c
parentd88316c243e5458a1888edbe0353c4dec6e61c73 (diff)
parent7032e8696726354d6180d8a2d17191f958cd93ae (diff)
Merge branch 'x86/core' into x86/headers
Diffstat (limited to 'mm/mprotect.c')
-rw-r--r--mm/mprotect.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/mprotect.c b/mm/mprotect.c
index abe2694e13f..258197b76fb 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -151,10 +151,11 @@ mprotect_fixup(struct vm_area_struct *vma, struct vm_area_struct **pprev,
/*
* If we make a private mapping writable we increase our commit;
* but (without finer accounting) cannot reduce our commit if we
- * make it unwritable again.
+ * make it unwritable again. hugetlb mapping were accounted for
+ * even if read-only so there is no need to account for them here
*/
if (newflags & VM_WRITE) {
- if (!(oldflags & (VM_ACCOUNT|VM_WRITE|
+ if (!(oldflags & (VM_ACCOUNT|VM_WRITE|VM_HUGETLB|
VM_SHARED|VM_NORESERVE))) {
charged = nrpages;
if (security_vm_enough_memory(charged))