Skip to content

Commit

Permalink
shmem: let shared anonymous be nonlinear again
Browse files Browse the repository at this point in the history
Up to 2.6.22, you could use remap_file_pages(2) on a tmpfs file or a
shared mapping of /dev/zero or a shared anonymous mapping.  In 2.6.23 we
disabled it by default, but set VM_CAN_NONLINEAR to enable it on safe
mappings.  We made sure to set it in shmem_mmap() for tmpfs files, but
missed it in shmem_zero_setup() for the others.  Fix that at last.

Reported-by: Kenny Simpson <[email protected]>
Signed-off-by: Hugh Dickins <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Hugh Dickins authored and torvalds committed Mar 23, 2011
1 parent 8f7a660 commit bee4c36
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mm/shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -2793,5 +2793,6 @@ int shmem_zero_setup(struct vm_area_struct *vma)
fput(vma->vm_file);
vma->vm_file = file;
vma->vm_ops = &shmem_vm_ops;
vma->vm_flags |= VM_CAN_NONLINEAR;
return 0;
}

0 comments on commit bee4c36

Please sign in to comment.