diff options
author | Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> | 2010-09-10 06:23:06 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-09-24 02:29:19 +0200 |
commit | a850ea30374ebed32a0724742601861853fde869 (patch) | |
tree | 436dda49aae61ac7c228a7fadb53fd0632666827 /mm/rmap.c | |
parent | hugetlb, rmap: fix confusing page locking in hugetlb_cow() (diff) | |
download | linux-a850ea30374ebed32a0724742601861853fde869.tar.xz linux-a850ea30374ebed32a0724742601861853fde869.zip |
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/rmap.c')
-rw-r--r-- | mm/rmap.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/rmap.c b/mm/rmap.c index 2854857fd63b..9d2ba01bd4f9 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1582,6 +1582,8 @@ void hugepage_add_anon_rmap(struct page *page, { struct anon_vma *anon_vma = vma->anon_vma; int first; + + BUG_ON(!PageLocked(page)); BUG_ON(!anon_vma); BUG_ON(address < vma->vm_start || address >= vma->vm_end); first = atomic_inc_and_test(&page->_mapcount); |