ignore holes in mlock to work around ld.so issue (#41356)
authorAndreas Kleen <ak@suse.de>
Fri, 28 May 2004 14:50:07 +0000 (14:50 +0000)
committerAndreas Kleen <ak@suse.de>
Fri, 28 May 2004 14:50:07 +0000 (14:50 +0000)
suse-commit: 9a3a30ee06d688c9430e0f29e954e6f681e3dc0c

mm/mlock.c

index 2387874..f16b7e1 100644 (file)
@@ -44,6 +44,13 @@ static int mlock_fixup(struct vm_area_struct * vma,
        if (newflags & VM_LOCKED) {
                pages = -pages;
                ret = make_pages_present(start, end);
+               /* Ran into a hole. This should be an error, but 
+                  some users specify too long lengths e.g. for 
+                  file maps. Ignore it for now.
+                  RED-PEN can locked_vm become negative when this happens? 
+                  Hopefully not. */
+               if (ret == -1) 
+                       ret = 0;
        }
 
        vma->vm_mm->locked_vm -= pages;