]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
shmem: let shared anonymous be nonlinear again
authorHugh Dickins <hughd@google.com>
Tue, 22 Mar 2011 23:33:43 +0000 (16:33 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 27 Mar 2011 18:30:27 +0000 (11:30 -0700)
commit bee4c36a5cf5c9f63ce1d7372aa62045fbd16d47 upstream.

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 <theonetruekenny@yahoo.com>
Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
mm/shmem.c

index 356dd99566ecb671cd324ba3dddcee10441312f0..3e0005bc52a8543a8a17a16121763d56cc578078 100644 (file)
@@ -2691,5 +2691,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;
 }