Skip to content

Commit

Permalink
[PATCH] mm: xip_unmap ZERO_PAGE fix
Browse files Browse the repository at this point in the history
Small fix to the PageReserved patch: the mips ZERO_PAGE(address) depends on
address, so __xip_unmap is wrong to initialize page with that before address
is initialized; and in fact must re-evaluate it each iteration.

Signed-off-by: Hugh Dickins <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Oct 30, 2005
1 parent 508034a commit 67b02f1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mm/filemap_xip.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,15 @@ __xip_unmap (struct address_space * mapping,
unsigned long address;
pte_t *pte;
pte_t pteval;
struct page *page = ZERO_PAGE(address);
struct page *page;

spin_lock(&mapping->i_mmap_lock);
vma_prio_tree_foreach(vma, &iter, &mapping->i_mmap, pgoff, pgoff) {
mm = vma->vm_mm;
address = vma->vm_start +
((pgoff - vma->vm_pgoff) << PAGE_SHIFT);
BUG_ON(address < vma->vm_start || address >= vma->vm_end);
page = ZERO_PAGE(address);
/*
* We need the page_table_lock to protect us from page faults,
* munmap, fork, etc...
Expand Down

0 comments on commit 67b02f1

Please sign in to comment.