summaryrefslogtreecommitdiff
path: root/mm/hugetlb.c
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2010-12-21 18:34:37 -0800
committerColin Cross <ccross@android.com>2010-12-21 18:34:37 -0800
commitb104a07edb2a319f734ddc4fe04852865d8d9e24 (patch)
treea0cd50b3d84ece4d94e366fac4b440e380c2d247 /mm/hugetlb.c
parente87ec4d59e1f96381547e614c5279bed63775719 (diff)
parenta1346c99fc89f2b3d35c7d7e2e4aef8ea4124342 (diff)
Merge commit 'v2.6.36.2' into linux-tegra-2.6.36
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r--mm/hugetlb.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index c03273807182..2697806746d0 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2380,8 +2380,11 @@ retry_avoidcopy:
* When the original hugepage is shared one, it does not have
* anon_vma prepared.
*/
- if (unlikely(anon_vma_prepare(vma)))
+ if (unlikely(anon_vma_prepare(vma))) {
+ /* Caller expects lock to be held */
+ spin_lock(&mm->page_table_lock);
return VM_FAULT_OOM;
+ }
copy_huge_page(new_page, old_page, address, vma);
__SetPageUptodate(new_page);
@@ -2665,7 +2668,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);