From: akpm@osdl.org
To: torvalds@osdl.org
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org, jmoyer@redhat.com
Subject: [patch 015/198] filemap_getpage can block when MAP_NONBLOCK specified
Date: Tue, 12 Apr 2005 03:30:47 -0700 [thread overview]
Message-ID: <200504121030.j3CAUrDl005171@shell0.pdx.osdl.net> (raw)
From: Jeff Moyer <jmoyer@redhat.com>
We will return NULL from filemap_getpage when a page does not exist in the
page cache and MAP_NONBLOCK is specified, here:
page = find_get_page(mapping, pgoff);
if (!page) {
if (nonblock)
return NULL;
goto no_cached_page;
}
But we forget to do so when the page in the cache is not uptodate. The
following could result in a blocking call:
/*
* Ok, found a page in the page cache, now we need to check
* that it's up-to-date.
*/
if (!PageUptodate(page))
goto page_not_uptodate;
Signed-off-by: Andrew Morton <akpm@osdl.org>
---
25-akpm/mm/filemap.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletion(-)
diff -puN mm/filemap.c~filemap_getpage-can-block-when-map_nonblock-specified mm/filemap.c
--- 25/mm/filemap.c~filemap_getpage-can-block-when-map_nonblock-specified 2005-04-12 03:21:07.024069080 -0700
+++ 25-akpm/mm/filemap.c 2005-04-12 03:21:07.028068472 -0700
@@ -1379,8 +1379,13 @@ retry_find:
* Ok, found a page in the page cache, now we need to check
* that it's up-to-date.
*/
- if (!PageUptodate(page))
+ if (!PageUptodate(page)) {
+ if (nonblock) {
+ page_cache_release(page);
+ return NULL;
+ }
goto page_not_uptodate;
+ }
success:
/*
_
reply other threads:[~2005-04-12 10:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200504121030.j3CAUrDl005171@shell0.pdx.osdl.net \
--to=akpm@osdl.org \
--cc=jmoyer@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.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
all inboxes | Powered by JetHome®