Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 2462
b: refs/heads/master
c: 941150a
h: refs/heads/master
v: v3
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Jun 22, 2005
1 parent 3f721ee commit 19f0b53
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 400e65146c428d2ef677a927786fda2cec545a76
refs/heads/master: 941150a326be88af245034ef4b3e9fa00229aa2d
19 changes: 14 additions & 5 deletions trunk/mm/mempolicy.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ static int
verify_pages(struct mm_struct *mm,
unsigned long addr, unsigned long end, unsigned long *nodes)
{
int err = 0;

spin_lock(&mm->page_table_lock);
while (addr < end) {
struct page *p;
pte_t *pte;
Expand All @@ -268,17 +271,23 @@ verify_pages(struct mm_struct *mm,
}
p = NULL;
pte = pte_offset_map(pmd, addr);
if (pte_present(*pte))
p = pte_page(*pte);
if (pte_present(*pte)) {
unsigned long pfn = pte_pfn(*pte);
if (pfn_valid(pfn))
p = pfn_to_page(pfn);
}
pte_unmap(pte);
if (p) {
unsigned nid = page_to_nid(p);
if (!test_bit(nid, nodes))
return -EIO;
if (!test_bit(nid, nodes)) {
err = -EIO;
break;
}
}
addr += PAGE_SIZE;
}
return 0;
spin_unlock(&mm->page_table_lock);
return err;
}

/* Step 1: check the range */
Expand Down

0 comments on commit 19f0b53

Please sign in to comment.