diff options
author | Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> | 2010-09-10 00:23:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-09-23 20:29:19 -0400 |
commit | a850ea30374ebed32a0724742601861853fde869 (patch) | |
tree | 436dda49aae61ac7c228a7fadb53fd0632666827 /mm | |
parent | 56c9cfb13c9b6516017eea4e8cbe22ea02e07ee6 (diff) |
hugetlb, rmap: add BUG_ON(!PageLocked) in hugetlb_add_anon_rmap()
Confirming page lock is held in hugetlb_add_anon_rmap() may be useful
to detect possible future problems.
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Acked-by: Rik van Riel <riel@redhat.com>
Acked-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/rmap.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -1582,6 +1582,8 @@ void hugepage_add_anon_rmap(struct page *page, | |||
1582 | { | 1582 | { |
1583 | struct anon_vma *anon_vma = vma->anon_vma; | 1583 | struct anon_vma *anon_vma = vma->anon_vma; |
1584 | int first; | 1584 | int first; |
1585 | |||
1586 | BUG_ON(!PageLocked(page)); | ||
1585 | BUG_ON(!anon_vma); | 1587 | BUG_ON(!anon_vma); |
1586 | BUG_ON(address < vma->vm_start || address >= vma->vm_end); | 1588 | BUG_ON(address < vma->vm_start || address >= vma->vm_end); |
1587 | first = atomic_inc_and_test(&page->_mapcount); | 1589 | first = atomic_inc_and_test(&page->_mapcount); |