aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorDean Nelson <dnelson@redhat.com>2010-10-26 17:22:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-26 19:52:11 -0400
commit44e2aa937e698ea95dd86b2a4fabd734ef2c76db (patch)
tree691e3e8b04f486fe8a13fc43587c0144275e7c70 /mm
parent70384dc6dcc6aa76762200262820bdb8b724ecd5 (diff)
mm/hugetlb.c: add missing spin_lock() to hugetlb_cow()
Add missing spin_lock() of the page_table_lock before an error return in hugetlb_cow(). Callers of hugtelb_cow() expect it to be held upon return. Signed-off-by: Dean Nelson <dnelson@redhat.com> Cc: Mel Gorman <mel@csn.ul.ie> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/hugetlb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 96991ded82fe..c4a3558589ab 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2448,8 +2448,11 @@ retry_avoidcopy:
2448 * When the original hugepage is shared one, it does not have 2448 * When the original hugepage is shared one, it does not have
2449 * anon_vma prepared. 2449 * anon_vma prepared.
2450 */ 2450 */
2451 if (unlikely(anon_vma_prepare(vma))) 2451 if (unlikely(anon_vma_prepare(vma))) {
2452 /* Caller expects lock to be held */
2453 spin_lock(&mm->page_table_lock);
2452 return VM_FAULT_OOM; 2454 return VM_FAULT_OOM;
2455 }
2453 2456
2454 copy_user_huge_page(new_page, old_page, address, vma); 2457 copy_user_huge_page(new_page, old_page, address, vma);
2455 __SetPageUptodate(new_page); 2458 __SetPageUptodate(new_page);