[folded-merged] mm-mlock-check-against-vma-for-actual-mlock-size-fix-2.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: mm: mlock: correct a typo in count_mm_mlocked_page_nr() for caculate VMLOCKED pages
has been removed from the -mm tree.  Its filename was
     mm-mlock-check-against-vma-for-actual-mlock-size-fix-2.patch

This patch was dropped because it was folded into mm-mlock-check-against-vma-for-actual-mlock-size.patch

------------------------------------------------------
From: Simon Guo <wei.guo.simon@xxxxxxxxx>
Subject: mm: mlock: correct a typo in count_mm_mlocked_page_nr() for caculate VMLOCKED pages

There is a typo/bug in count_mm_mlocked_page_nr() for "&" which is
mistakenly used with "&&".

Also add more checks and some minor change based on Kirill's previous
comment.

Link: http://lkml.kernel.org/r/1473325970-11393-2-git-send-email-wei.guo.simon@xxxxxxxxx
Signed-off-by: Simon Guo <wei.guo.simon@xxxxxxxxx>
Suggested-by: Kirill A. Shutemov <kirill@xxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/mlock.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff -puN mm/mlock.c~mm-mlock-check-against-vma-for-actual-mlock-size-fix-2 mm/mlock.c
--- a/mm/mlock.c~mm-mlock-check-against-vma-for-actual-mlock-size-fix-2
+++ a/mm/mlock.c
@@ -638,9 +638,11 @@ static int count_mm_mlocked_page_nr(stru
 		vma = mm->mmap;
 
 	for (; vma ; vma = vma->vm_next) {
+		if (start >= vma->vm_end)
+			continue;
 		if (start + len <=  vma->vm_start)
 			break;
-		if (vma->vm_flags && VM_LOCKED) {
+		if (vma->vm_flags & VM_LOCKED) {
 			if (start > vma->vm_start)
 				count -= (start - vma->vm_start);
 			if (start + len < vma->vm_end) {
@@ -651,7 +653,7 @@ static int count_mm_mlocked_page_nr(stru
 		}
 	}
 
-	return (PAGE_ALIGN(count) >> PAGE_SHIFT);
+	return count >> PAGE_SHIFT;
 }
 
 static __must_check int do_mlock(unsigned long start, size_t len, vm_flags_t flags)
_

Patches currently in -mm which might be from wei.guo.simon@xxxxxxxxx are

mm-mlock-check-against-vma-for-actual-mlock-size.patch
mm-mlock-avoid-increase-mm-locked_vm-on-mlock-when-already-mlock2mlock_onfault.patch
selftest-split-mlock2_-funcs-into-separate-mlock2h.patch
selftests-vm-add-test-for-mlock-when-areas-are-intersected.patch
selftest-move-seek_to_smaps_entry-out-of-mlock2-testsc.patch
selftests-expanding-more-mlock-selftest.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]
  Powered by Linux