Skip to content

Commit

Permalink
NOMMU: Revert 'nommu: get_user_pages(): pin last page on non-page-ali…
Browse files Browse the repository at this point in the history
…gned start'

Revert the following patch:

	commit c08c6e1
	Author: Steven J. Magnani <steve@digidescorp.com>
	Date:   Fri Mar 5 13:42:24 2010 -0800

	nommu: get_user_pages(): pin last page on non-page-aligned start

As it assumes that the mappings begin at the start of pages - something that
isn't necessarily true on NOMMU systems.  On NOMMU systems, it is possible for
a mapping to only occupy part of the page, and not necessarily touch either end
of it; in fact it's also possible for multiple non-overlapping mappings to
coexist on one page (consider direct mappings of ROMFS files, for example).

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Steven J. Magnani <steve@digidescorp.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
David Howells authored and Linus Torvalds committed Mar 25, 2010
1 parent 39f1cd6 commit 7561e8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mm/nommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
(VM_MAYREAD | VM_MAYWRITE) : (VM_READ | VM_WRITE);

for (i = 0; i < nr_pages; i++) {
vma = find_extend_vma(mm, start);
vma = find_vma(mm, start);
if (!vma)
goto finish_or_fault;

Expand Down Expand Up @@ -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 & PAGE_MASK);
return find_vma(mm, addr);
}

/*
Expand Down

0 comments on commit 7561e8c

Please sign in to comment.