Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 199817
b: refs/heads/master
c: d6d03f9
h: refs/heads/master
i:
  199815: 2e14b00
v: v3
  • Loading branch information
Albert Herranz authored and Linus Torvalds committed Jun 4, 2010
1 parent 32169d5 commit 59bc0cb
Show file tree
Hide file tree
Showing 2 changed files with 12 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: 3f505ca45735c35576dab4ceb3e3736d528b6672
refs/heads/master: d6d03f9158516b50d0d343158e3f33bcff1e4ca5
12 changes: 11 additions & 1 deletion trunk/drivers/video/fb_defio.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ static int fb_deferred_io_mkwrite(struct vm_area_struct *vma,
/* protect against the workqueue changing the page list */
mutex_lock(&fbdefio->lock);

/*
* We want the page to remain locked from ->page_mkwrite until
* the PTE is marked dirty to avoid page_mkclean() being called
* before the PTE is updated, which would leave the page ignored
* by defio.
* Do this by locking the page here and informing the caller
* about it with VM_FAULT_LOCKED.
*/
lock_page(page);

/* we loop through the pagelist before adding in order
to keep the pagelist sorted */
list_for_each_entry(cur, &fbdefio->pagelist, lru) {
Expand All @@ -121,7 +131,7 @@ static int fb_deferred_io_mkwrite(struct vm_area_struct *vma,

/* come back after delay to process the deferred IO */
schedule_delayed_work(&info->deferred_work, fbdefio->delay);
return 0;
return VM_FAULT_LOCKED;
}

static const struct vm_operations_struct fb_deferred_io_vm_ops = {
Expand Down

0 comments on commit 59bc0cb

Please sign in to comment.