Commit a850ea30374ebed32a0724742601861853fde869
Committed by
Linus Torvalds
1 parent
56c9cfb13c
Exists in
master
and in
7 other branches
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>
Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff
mm/rmap.c
... | ... | @@ -1582,6 +1582,8 @@ |
1582 | 1582 | { |
1583 | 1583 | struct anon_vma *anon_vma = vma->anon_vma; |
1584 | 1584 | int first; |
1585 | + | |
1586 | + BUG_ON(!PageLocked(page)); | |
1585 | 1587 | BUG_ON(!anon_vma); |
1586 | 1588 | BUG_ON(address < vma->vm_start || address >= vma->vm_end); |
1587 | 1589 | first = atomic_inc_and_test(&page->_mapcount); |