linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix for vma merging refcounting bug
@ 2003-05-09 12:34 Stephen C. Tweedie
  2003-05-10 16:33 ` Andrea Arcangeli
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen C. Tweedie @ 2003-05-09 12:34 UTC (permalink / raw)
  To: linux-kernel, linux-mm; +Cc: Stephen Tweedie, Andrew Morton, Andrea Arcangeli

When a new vma can be merged simultaneously with its two immediate
neighbours in both directions, vma_merge() extends the predecessor vma
and deletes the successor.  However, if the vma maps a file, it fails to
fput() when doing the delete, leaving the file's refcount inconsistent.

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1083  -> 1.1084 
#	           mm/mmap.c	1.79    -> 1.80   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/05/09	sct@sisko.scot.redhat.com	1.1084
# Fix vma merging problem leading to file refcount getting out of sync.
# --------------------------------------------
#
diff -Nru a/mm/mmap.c b/mm/mmap.c
--- a/mm/mmap.c	Fri May  9 13:26:53 2003
+++ b/mm/mmap.c	Fri May  9 13:26:53 2003
@@ -471,6 +471,8 @@
 			spin_unlock(lock);
 			if (need_up)
 				up(&inode->i_mapping->i_shared_sem);
+			if (file)
+				fput(file);
 
 			mm->map_count--;
 			kmem_cache_free(vm_area_cachep, next);


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

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

end of thread, other threads:[~2003-05-13 23:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-09 12:34 [PATCH] Fix for vma merging refcounting bug Stephen C. Tweedie
2003-05-10 16:33 ` Andrea Arcangeli
2003-05-11 20:04   ` Stephen C. Tweedie
2003-05-13 22:52     ` Andrea Arcangeli
2003-05-13 23:05       ` Andrea Arcangeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox