From: Chen Gang <gang.chen@asianux.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>, Mel Gorman <mgorman@suse.de>,
rientjes@google.com, sasha.levin@oracle.com,
linux@rasmusvillemoes.dk, kosaki.motohiro@jp.fujitsu.com,
Wu Fengguang <fengguang.wu@intel.com>,
lczerner@redhat.com, linux-mm@kvack.org
Subject: [PATCH] mm/madvise.c: return 0 instead of read bytes after force_page_cache_readahead() succeeds.
Date: Tue, 15 Oct 2013 20:12:56 +0800 [thread overview]
Message-ID: <525D3148.8030707@asianux.com> (raw)
In-Reply-To: <525CF787.6050107@asianux.com>
madvise_willneed() will return 0 when succeed, so need return 0 instead
of read bytes after force_page_cache_readahead() succeeds.
The related commit: "fee53ce mm/readahead.c: return the value which
force_page_cache_readahead() returns" causes this issue.
After modification, it can pass LTP common test (disable CONFIG_SWAP).
Although the original one also can pass LTP common test, still better
to fix it.
Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
mm/madvise.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/mm/madvise.c b/mm/madvise.c
index dee8d46..3a739cd 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -220,6 +220,7 @@ static long madvise_willneed(struct vm_area_struct *vma,
unsigned long start, unsigned long end)
{
struct file *file = vma->vm_file;
+ int ret = 0;
#ifdef CONFIG_SWAP
if (!file || mapping_cap_swap_backed(file->f_mapping)) {
@@ -247,8 +248,9 @@ static long madvise_willneed(struct vm_area_struct *vma,
end = vma->vm_end;
end = ((end - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
- return force_page_cache_readahead(file->f_mapping, file,
+ ret = force_page_cache_readahead(file->f_mapping, file,
start, end - start);
+ return ret < 0 ? ret : 0;
}
/*
--
1.7.7.6
--
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>
next prev parent reply other threads:[~2013-10-15 12:14 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-20 3:31 [PATCH] mm: readahead: return the value which force_page_cache_readahead() returns Chen Gang
2013-08-20 23:16 ` Andrew Morton
2013-08-21 2:29 ` Chen Gang
2013-08-21 2:41 ` [PATCH v2] m: " Chen Gang
2013-09-03 5:27 ` Chen Gang
2013-09-17 22:56 ` Andrew Morton
2013-09-18 1:59 ` Chen Gang
2013-10-15 8:06 ` [PATCH] mm/readahead.c: need always return 0 when system call readahead() succeeds Chen Gang
2013-10-15 12:12 ` Chen Gang [this message]
2013-10-16 23:06 ` David Rientjes
2013-10-17 0:57 ` Chen Gang
2013-10-17 1:17 ` David Rientjes
2013-10-17 1:32 ` Chen Gang
2013-10-17 2:21 ` David Rientjes
2013-10-17 2:37 ` Chen Gang
2013-10-17 2:40 ` Chen Gang
2013-10-15 8:20 ` [PATCH v2] m: readahead: return the value which force_page_cache_readahead() returns Chen Gang
2013-10-17 9:56 ` Chen Gang
2013-11-04 5:31 ` [PATCH v3] mm: readahead: check return " Chen Gang
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=525D3148.8030707@asianux.com \
--to=gang.chen@asianux.com \
--cc=akpm@linux-foundation.org \
--cc=fengguang.wu@intel.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=lczerner@redhat.com \
--cc=linux-mm@kvack.org \
--cc=linux@rasmusvillemoes.dk \
--cc=mgorman@suse.de \
--cc=rientjes@google.com \
--cc=sasha.levin@oracle.com \
--cc=viro@zeniv.linux.org.uk \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.