Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176309
b: refs/heads/master
c: c9d0bf2
h: refs/heads/master
i:
  176307: de94a00
v: v3
  • Loading branch information
Magnus Damm authored and Linus Torvalds committed Dec 15, 2009
1 parent 5ec2c1b commit 40e14bd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 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: 62c0c2f198c1f2ead05c961e83ef486c45888325
refs/heads/master: c9d0bf241451a3ab7d02e1652c22b80cd7d93e8f
14 changes: 13 additions & 1 deletion trunk/mm/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1198,8 +1198,20 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
goto free_vma;
}

if (vma_wants_writenotify(vma))
if (vma_wants_writenotify(vma)) {
pgprot_t pprot = vma->vm_page_prot;

/* Can vma->vm_page_prot have changed??
*
* Answer: Yes, drivers may have changed it in their
* f_op->mmap method.
*
* Ensures that vmas marked as uncached stay that way.
*/
vma->vm_page_prot = vm_get_page_prot(vm_flags & ~VM_SHARED);
if (pgprot_val(pprot) == pgprot_val(pgprot_noncached(pprot)))
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
}

vma_link(mm, vma, prev, rb_link, rb_parent);
file = vma->vm_file;
Expand Down

0 comments on commit 40e14bd

Please sign in to comment.