linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Yan Zheng" <yanzheng@21cn.com>
To: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org
Subject: [PATCH]fix page release issue in filemap_fault
Date: Mon, 8 Oct 2007 23:28:07 +0800	[thread overview]
Message-ID: <3d0408630710080828h7ad160dbxf6cbd8513c1ad3e8@mail.gmail.com> (raw)

Hi all

find_lock_page increases page's usage count, we should decrease it
before return VM_FAULT_SIGBUS

Signed-off-by: Yan Zheng<yanzheng@21cn.com>
----
diff -ur linux-2.6.23-rc9/mm/filemap.c linux/mm/filemap.c
--- linux-2.6.23-rc9/mm/filemap.c	2007-10-07 15:03:33.000000000 +0800
+++ linux/mm/filemap.c	2007-10-08 23:14:39.000000000 +0800
@@ -1388,6 +1388,7 @@
 	size = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
 	if (unlikely(vmf->pgoff >= size)) {
 		unlock_page(page);
+		page_cache_release(page);
 		goto outside_data_content;
 	}

--
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:"dont@kvack.org"> email@kvack.org </a>

             reply	other threads:[~2007-10-08 15:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-08 15:28 Yan Zheng [this message]
2007-10-08 17:15 ` Peter Zijlstra
2007-10-08 17:23   ` Rik van Riel

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=3d0408630710080828h7ad160dbxf6cbd8513c1ad3e8@mail.gmail.com \
    --to=yanzheng@21cn.com \
    --cc=akpm@linux-foundation.org \
    --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