diff options
| -rw-r--r-- | mm/mlock.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mm/mlock.c b/mm/mlock.c index 13e81ee8be9d..c3924c7f00be 100644 --- a/mm/mlock.c +++ b/mm/mlock.c | |||
| @@ -178,6 +178,13 @@ static long __mlock_vma_pages_range(struct vm_area_struct *vma, | |||
| 178 | if ((vma->vm_flags & (VM_WRITE | VM_SHARED)) == VM_WRITE) | 178 | if ((vma->vm_flags & (VM_WRITE | VM_SHARED)) == VM_WRITE) |
| 179 | gup_flags |= FOLL_WRITE; | 179 | gup_flags |= FOLL_WRITE; |
| 180 | 180 | ||
| 181 | /* | ||
| 182 | * We want mlock to succeed for regions that have any permissions | ||
| 183 | * other than PROT_NONE. | ||
| 184 | */ | ||
| 185 | if (vma->vm_flags & (VM_READ | VM_WRITE | VM_EXEC)) | ||
| 186 | gup_flags |= FOLL_FORCE; | ||
| 187 | |||
| 181 | if (vma->vm_flags & VM_LOCKED) | 188 | if (vma->vm_flags & VM_LOCKED) |
| 182 | gup_flags |= FOLL_MLOCK; | 189 | gup_flags |= FOLL_MLOCK; |
| 183 | 190 | ||
