Commit e735f278 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] flush_dcache_page in get_user_pages()

Davem said:

"Ho hum, it is tricky :-)))

 At bio_map_user() you need to see the user's most recent write to the
 page if you are going "user --> device".  So if "user --> device"
 bio_map_user() must flush_dcache_page().

 I find the write_to_vm condition confusion which is probably why I am
 sitting here spelling this out :-)

 At bio_unmap_user(), if we are going "device --> user" you have to
 flush_dcache_page().  And actually, this flush could just as
 legitimately occur at bio_map_user() time.

 Therefore, the easiest thing to do is always flush_dcache_page() at
 bio_map_user().

 All the other cases are going to be like this, so we might as well
 cut to the chase and flush_dcache_page() for all the pages inside of
 get_user_pages()."
parent 79425084
......@@ -584,6 +584,7 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
i = -EFAULT;
goto out;
}
flush_dcache_page(pages[i]);
if (!PageReserved(pages[i]))
page_cache_get(pages[i]);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment