Adam Litke 5b23dbe817 hugetlb: follow_hugetlb_page() for write access
When calling get_user_pages(), a write flag is passed in by the caller to
indicate if write access is required on the faulted-in pages.  Currently,
follow_hugetlb_page() ignores this flag and always faults pages for
read-only access.  This can cause data corruption because a device driver
that calls get_user_pages() with write set will not expect COW faults to
occur on the returned pages.

This patch passes the write flag down to follow_hugetlb_page() and makes
sure hugetlb_fault() is called with the right write_access parameter.

[ezk@cs.sunysb.edu: build fix]
Signed-off-by: Adam Litke <agl@us.ibm.com>
Reviewed-by: Ken Chen <kenchen@google.com>
Cc: David Gibson <hermes@gibson.dropbear.id.au>
Cc: William Lee Irwin III <wli@holomorphy.com>
Cc: Badari Pulavarty <pbadari@us.ibm.com>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:39 -08:00
..
2007-10-17 08:42:45 -07:00
2007-10-16 09:42:54 -07:00
2007-10-20 02:46:58 +02:00
2007-10-16 09:43:02 -07:00
2007-10-20 01:27:18 +02:00
2007-10-20 02:13:26 +02:00
2007-10-23 08:32:06 -07:00
2007-10-18 14:37:31 -07:00
2007-10-29 07:53:26 -07:00
2007-10-20 15:04:06 -07:00
2007-10-20 01:27:18 +02:00
2007-10-17 08:42:45 -07:00
2007-11-12 10:32:29 -08:00
2007-10-20 01:27:18 +02:00
2007-10-17 08:42:55 -07:00
2007-10-20 01:27:18 +02:00
2007-10-20 01:27:18 +02:00