LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] sys_remap_file_pages: fix ->vm_file accounting
@ 2008-01-30 14:20 Oleg Nesterov
  2008-01-30 16:55 ` Miklos Szeredi
  0 siblings, 1 reply; 12+ messages in thread
From: Oleg Nesterov @ 2008-01-30 14:20 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Miklos Szeredi, Peter Zijlstra, William Lee Irwin III,
	Nick Piggin, Ingo Molnar, linux-kernel, stable

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

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>

--- 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 {


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2008-02-11 10:16 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-30 14:20 [PATCH] sys_remap_file_pages: fix ->vm_file accounting Oleg Nesterov
2008-01-30 16:55 ` Miklos Szeredi
2008-01-30 17:26   ` Oleg Nesterov
2008-02-02 20:52     ` Matt Helsley
2008-02-02 21:17     ` Matt Helsley
2008-02-03 18:21       ` Oleg Nesterov
2008-02-06 20:33         ` Hugh Dickins
2008-02-07  0:16           ` Matt Helsley
2008-02-07 16:40             ` Hugh Dickins
2008-02-03 18:29     ` Oleg Nesterov
2008-02-06 20:13       ` Hugh Dickins
2008-02-11 10:15         ` Oleg Nesterov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).