From: Adam Litke Date: Thu, 15 Nov 2007 00:59:33 +0000 (-0800) Subject: hugetlb: follow_hugetlb_page() for write access X-Git-Tag: v2.6.24-rc3~96 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b23dbe8173c212d6a326e35347b038705603d39;p=pandora-kernel.git 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 Reviewed-by: Ken Chen Cc: David Gibson Cc: William Lee Irwin III Cc: Badari Pulavarty Signed-off-by: Erez Zadok Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed