From: Dean Nelson Date: Thu, 2 Dec 2010 22:31:12 +0000 (-0800) Subject: mm/hugetlb.c: avoid double unlock_page() in hugetlb_fault() X-Git-Tag: v2.6.37-rc5~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1f64d69c7ad2e48e697493e45590679f7a69b7b2;p=platform%2Fkernel%2Flinux-3.10.git mm/hugetlb.c: avoid double unlock_page() in hugetlb_fault() Have hugetlb_fault() call unlock_page(page) only if it had previously called lock_page(page). Setting CONFIG_DEBUG_VM=y and then running the libhugetlbfs test suite, resulted in the tripping of VM_BUG_ON(!PageLocked(page)) in unlock_page() having been called by hugetlb_fault() when page == pagecache_page. This patch remedied the problem. Signed-off-by: Dean Nelson Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/hugetlb.c b/mm/hugetlb.c index c4a3558..8585524 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2738,7 +2738,8 @@ out_page_table_lock: unlock_page(pagecache_page); put_page(pagecache_page); } - unlock_page(page); + if (page != pagecache_page) + unlock_page(page); out_mutex: mutex_unlock(&hugetlb_instantiation_mutex);