提交 1f64d69c 编写于 作者: D Dean Nelson 提交者: Linus Torvalds

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: NDean Nelson <dnelson@redhat.com>
Cc: <stable@kernel.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 94c35de9
......@@ -2738,7 +2738,8 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册