aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorWilliam Lee Irwin III <wli@holomorphy.com>2004-07-04 20:26:54 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-07-04 20:26:54 -0700
commitc95d2b854691478f55e24feab9e4117bd801c6dd (patch)
treeb174bfba8d543363e6ec5fc36ffb9449d82a309f /mm
parent7e241bcbbe58d27d6bbe8012fd1a888efe4fc160 (diff)
downloadhistory-c95d2b854691478f55e24feab9e4117bd801c6dd.tar.gz
[PATCH] spurious remap_file_pages() -EINVAL
As ->vm_private_data is used as a cursor for swapout of VM_NONLINEAR vmas, the check for NULL ->vm_private_data or VM_RESERVED is too strict, and should allow VM_NONLINEAR vmas with non-NULL ->vm_private_data. This fixes an issue on 2.6.7-mm5 where system calls to remap_file_pages() spuriously failed while under memory pressure. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/fremap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/fremap.c b/mm/fremap.c
index eae08b22a0544a..e10dcea9791373 100644
--- a/mm/fremap.c
+++ b/mm/fremap.c
@@ -194,7 +194,8 @@ asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size,
* or VM_LOCKED, but VM_LOCKED could be revoked later on).
*/
if (vma && (vma->vm_flags & VM_SHARED) &&
- (!vma->vm_private_data || (vma->vm_flags & VM_RESERVED)) &&
+ (!vma->vm_private_data ||
+ (vma->vm_flags & (VM_NONLINEAR|VM_RESERVED))) &&
vma->vm_ops && vma->vm_ops->populate &&
end > start && start >= vma->vm_start &&
end <= vma->vm_end) {