From: Nick Piggin <npiggin@suse.de>
To: Boll Liu <bollliu@gmail.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
kamezawa.hiroyu@jp.fujitsu.com
Subject: Re: [PATCH] add vma->ops check before do_nonlinear_fault()
Date: Wed, 9 Sep 2009 18:25:50 +0200 [thread overview]
Message-ID: <20090909162550.GG6034@wotan.suse.de> (raw)
In-Reply-To: <1252513094-8731-1-git-send-email-BollLiu@gmail.com>
On Thu, Sep 10, 2009 at 12:18:14AM +0800, Boll Liu wrote:
> 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().
I don't think we'd ever install a pte_file entry there for a
filesystem that cannot handle it (ie. does not have a ->fault).
So I don't think this is needed.
>
> 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>
prev parent reply other threads:[~2009-09-09 16:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-09 16:18 Boll Liu
2009-09-09 16:25 ` Nick Piggin [this message]
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=20090909162550.GG6034@wotan.suse.de \
--to=npiggin@suse.de \
--cc=akpm@linux-foundation.org \
--cc=bollliu@gmail.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--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