From: "Steven J. Magnani" <steve@digidescorp.com>
To: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org,
"Steven J. Magnani" <steve@digidescorp.com>
Subject: [PATCH] nommu: get_user_pages(): pin last page on non-page-aligned start
Date: Tue, 2 Mar 2010 12:29:44 -0600 [thread overview]
Message-ID: <1267554584-24349-1-git-send-email-steve@digidescorp.com> (raw)
The noMMU version of get_user_pages() fails to pin the last page
when the start address isn't page-aligned. The patch fixes this in a way
that makes find_extend_vma() congruent to its MMU cousin.
Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
---
diff -uprN a/mm/nommu.c b/mm/nommu.c
--- a/mm/nommu.c 2010-03-01 16:37:31.000000000 -0600
+++ b/mm/nommu.c 2010-03-01 21:34:49.000000000 -0600
@@ -146,7 +146,7 @@ int __get_user_pages(struct task_struct
(VM_MAYREAD | VM_MAYWRITE) : (VM_READ | VM_WRITE);
for (i = 0; i < nr_pages; i++) {
- vma = find_vma(mm, start);
+ vma = find_extend_vma(mm, start);
if (!vma)
goto finish_or_fault;
@@ -764,7 +764,7 @@ EXPORT_SYMBOL(find_vma);
*/
struct vm_area_struct *find_extend_vma(struct mm_struct *mm, unsigned long addr)
{
- return find_vma(mm, addr);
+ return find_vma(mm, addr & PAGE_MASK);
}
/*
--
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:[~2010-03-02 18:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-02 18:29 Steven J. Magnani [this message]
2010-03-03 3:03 ` [PATCH] nommu: get_user_pages(): pin last page on non-page-aligned start Paul Mundt
2010-03-08 9:38 ` David Howells
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=1267554584-24349-1-git-send-email-steve@digidescorp.com \
--to=steve@digidescorp.com \
--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;
as well as URLs for NNTP newsgroup(s).