From: Naoya Horiguchi Date: Fri, 10 Sep 2010 04:23:04 +0000 (+0900) Subject: hugetlb, rmap: fix confusing page locking in hugetlb_cow() X-Git-Tag: v2.6.36-rc6~46 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56c9cfb13c9b6516017eea4e8cbe22ea02e07ee6;p=pandora-kernel.git hugetlb, rmap: fix confusing page locking in hugetlb_cow() The "if (!trylock_page)" block in the avoidcopy path of hugetlb_cow() looks confusing and is buggy. Originally this trylock_page() was intended to make sure that old_page is locked even when old_page != pagecache_page, because then only pagecache_page is locked. This patch fixes it by moving page locking into hugetlb_fault(). Signed-off-by: Naoya Horiguchi Acked-by: Rik van Riel Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed