We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3afa793 commit f433195Copy full SHA for f433195
mm/mremap.c
@@ -766,14 +766,8 @@ static struct vm_area_struct *vma_to_resize(unsigned long addr,
766
if (vma->vm_flags & (VM_DONTEXPAND | VM_PFNMAP))
767
return ERR_PTR(-EFAULT);
768
769
- if (vma->vm_flags & VM_LOCKED) {
770
- unsigned long locked, lock_limit;
771
- locked = mm->locked_vm << PAGE_SHIFT;
772
- lock_limit = rlimit(RLIMIT_MEMLOCK);
773
- locked += new_len - old_len;
774
- if (locked > lock_limit && !capable(CAP_IPC_LOCK))
775
- return ERR_PTR(-EAGAIN);
776
- }
+ if (mlock_future_check(mm, vma->vm_flags, new_len - old_len))
+ return ERR_PTR(-EAGAIN);
777
778
if (!may_expand_vm(mm, vma->vm_flags,
779
(new_len - old_len) >> PAGE_SHIFT))
0 commit comments