diff options
author | Hugh Dickins <hughd@google.com> | 2011-03-22 16:33:43 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-03-28 07:31:19 -0700 |
commit | 430d446e6ce0dfe0c37a0abdf5d2899770ccb4d6 (patch) | |
tree | fa5acc8079fd4d664ec38261c25f311eeb02c41e /mm/shmem.c | |
parent | d7c5057e3b12825b417b1ad4da374ac8ee046484 (diff) | |
download | linux-rt-430d446e6ce0dfe0c37a0abdf5d2899770ccb4d6.tar.gz |
shmem: let shared anonymous be nonlinear again
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>
Diffstat (limited to 'mm/shmem.c')
-rw-r--r-- | mm/shmem.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/mm/shmem.c b/mm/shmem.c index eef4ebea5158..0203cda3297a 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2701,5 +2701,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; } |