Subject: Re: [PATCH] hugetlb: follow_hugetlb_page for write access

From: Hoang-Nam Nguyen <[email-masked]>
Date: Mon, 19 Nov 2007 16:25:00 +0100

On Wednesday 07 November 2007 20:51, Adam Litke wrote:
> 
> 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.
> 
> Signed-off-by: Adam Litke <[email-masked]>
Apologize for this late response.
Tested on 2.6.23 with ehca and mthca. It works like a charm for me.
Thanks!
Nam