From: Hugh Dickins Date: Tue, 22 Mar 2011 23:33:43 +0000 (-0700) Subject: shmem: let shared anonymous be nonlinear again X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bee4c36a5cf5c9f63ce1d7372aa62045fbd16d47;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git shmem: let shared anonymous be nonlinear again 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 Signed-off-by: Hugh Dickins Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/shmem.c b/mm/shmem.c index 88593586bdb7..91ce9a1024d7 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -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; }