[PATCH] sys_remap_file_pages: fix ->vm_file accounting

From: Oleg Nesterov
Date: Wed Jan 30 2008 - 09:17:54 EST


Fix ->vm_file accounting, mmap_region() may do do_munmap().

Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>

--- MM/mm/fremap.c~RFP 2007-10-25 16:22:12.000000000 +0400
+++ MM/mm/fremap.c 2008-01-30 16:56:39.000000000 +0300
@@ -192,8 +192,10 @@ asmlinkage long sys_remap_file_pages(uns
unsigned long addr;

flags &= MAP_NONBLOCK;
+ get_file(vma->vm_file);
addr = mmap_region(vma->vm_file, start, size,
flags, vma->vm_flags, pgoff, 1);
+ fput(vma->vm_file);
if (IS_ERR_VALUE(addr)) {
err = addr;
} else {

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/