diff options
author | Dean Nelson <dnelson@redhat.com> | 2010-10-26 14:22:08 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-12-09 13:32:35 -0800 |
commit | 8cf6b1558e1cc4fe2f4c584dd12c2a1ddaa38388 (patch) | |
tree | dca5e83b6649bfa4dfce9c585575a73d42d8381c | |
parent | 57986f1185a74ef98ded566d25f9cc6f3d699ef7 (diff) |
mm/hugetlb.c: add missing spin_lock() to hugetlb_cow()
commit 44e2aa937e698ea95dd86b2a4fabd734ef2c76db upstream.
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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | mm/hugetlb.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index c03273807182..8ee804bdbbab 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); |