]> git.baikalelectronics.ru Git - kernel.git/commit
hugetlb, rmap: fix confusing page locking in hugetlb_cow()
authorNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Fri, 10 Sep 2010 04:23:04 +0000 (13:23 +0900)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 24 Sep 2010 00:29:18 +0000 (17:29 -0700)
commit7418f350add6dae12621289d08505b68de715813
tree1b09c9350d8f48d81514f274a3a1933dc9f1a2ef
parent72c109746ff0e5d2bd821b93e12da346bc52181d
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 <n-horiguchi@ah.jp.nec.com>
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/hugetlb.c