diff options
author | Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> | 2010-07-02 01:47:20 -0400 |
---|---|---|
committer | Andi Kleen <ak@linux.intel.com> | 2010-08-11 03:23:48 -0400 |
commit | 28957a5467bab9ed51a237d21e31055fad987887 (patch) | |
tree | 1bc0a2bee4744516fb9874e36bbd7eb6cd9020b3 /mm/hugetlb.c | |
parent | e3390f67a7267daa227380b6f1bbf13c7ddd4aff (diff) |
hugetlb: add missing unlock in avoidcopy path in hugetlb_cow()
This patch fixes possible deadlock in hugepage lock_page()
by adding missing unlock_page().
libhugetlbfs test will hit this bug when the next patch in this
patchset ("hugetlb, HWPOISON: move PG_HWPoison bit check") is applied.
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Acked-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r-- | mm/hugetlb.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 3c275ffd32a7..303fb0c02364 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -2324,9 +2324,11 @@ retry_avoidcopy: | |||
2324 | * and just make the page writable */ | 2324 | * and just make the page writable */ |
2325 | avoidcopy = (page_mapcount(old_page) == 1); | 2325 | avoidcopy = (page_mapcount(old_page) == 1); |
2326 | if (avoidcopy) { | 2326 | if (avoidcopy) { |
2327 | if (!trylock_page(old_page)) | 2327 | if (!trylock_page(old_page)) { |
2328 | if (PageAnon(old_page)) | 2328 | if (PageAnon(old_page)) |
2329 | page_move_anon_rmap(old_page, vma, address); | 2329 | page_move_anon_rmap(old_page, vma, address); |
2330 | } else | ||
2331 | unlock_page(old_page); | ||
2330 | set_huge_ptep_writable(vma, address, ptep); | 2332 | set_huge_ptep_writable(vma, address, ptep); |
2331 | return 0; | 2333 | return 0; |
2332 | } | 2334 | } |