From: "Stephen C. Tweedie" <sct@redhat.com>
To: linux-kernel <linux-kernel@vger.kernel.org>,
linux-mm <linux-mm@kvack.org>
Cc: Stephen Tweedie <sct@redhat.com>, Andrew Morton <akpm@digeo.com>,
Andrea Arcangeli <andrea@suse.de>
Subject: [PATCH] Fix for vma merging refcounting bug
Date: 09 May 2003 13:34:21 +0100 [thread overview]
Message-ID: <1052483661.3642.16.camel@sisko.scot.redhat.com> (raw)
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>
next reply other threads:[~2003-05-09 12:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-09 12:34 Stephen C. Tweedie [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1052483661.3642.16.camel@sisko.scot.redhat.com \
--to=sct@redhat.com \
--cc=akpm@digeo.com \
--cc=andrea@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox