From: Boll Liu <bollliu@gmail.com>
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org, npiggin@suse.de,
kamezawa.hiroyu@jp.fujitsu.com, Boll Liu <BollLiu@gmail.com>
Subject: [PATCH] add vma->ops check before do_nonlinear_fault()
Date: Thu, 10 Sep 2009 00:18:14 +0800 [thread overview]
Message-ID: <1252513094-8731-1-git-send-email-BollLiu@gmail.com> (raw)
Function do_nonlinear_fault() will also call vma->vm_ops->fault().
So add vma->ops and vma->vm_ops->fault check the same as before
calling do_nonlinear_fault().
Signed-off-by: Boll Liu <BollLiu@gmail.com>
---
mm/memory.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/mm/memory.c b/mm/memory.c
index aede2ce..86ebdd6 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2921,9 +2921,13 @@ static inline int handle_pte_fault(struct mm_struct *mm,
return do_anonymous_page(mm, vma, address,
pte, pmd, flags);
}
- if (pte_file(entry))
- return do_nonlinear_fault(mm, vma, address,
- pte, pmd, flags, entry);
+ if (pte_file(entry)) {
+ if (vma->vm_ops) {
+ if (likely(vma->vm_ops->fault))
+ return do_nonlinear_fault(mm, vma, address,
+ pte, pmd, flags, entry);
+ }
+ }
return do_swap_page(mm, vma, address,
pte, pmd, flags, entry);
}
--
1.5.6.3
--
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 reply other threads:[~2009-09-09 16:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-09 16:18 Boll Liu [this message]
2009-09-09 16:25 ` Nick Piggin
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=1252513094-8731-1-git-send-email-BollLiu@gmail.com \
--to=bollliu@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-mm@kvack.org \
--cc=npiggin@suse.de \
/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