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>
This commit is contained in:
parent
56c9cfb13c
commit
a850ea3037
|
@ -1582,6 +1582,8 @@ void hugepage_add_anon_rmap(struct page *page,
|
||||||
{
|
{
|
||||||
struct anon_vma *anon_vma = vma->anon_vma;
|
struct anon_vma *anon_vma = vma->anon_vma;
|
||||||
int first;
|
int first;
|
||||||
|
|
||||||
|
BUG_ON(!PageLocked(page));
|
||||||
BUG_ON(!anon_vma);
|
BUG_ON(!anon_vma);
|
||||||
BUG_ON(address < vma->vm_start || address >= vma->vm_end);
|
BUG_ON(address < vma->vm_start || address >= vma->vm_end);
|
||||||
first = atomic_inc_and_test(&page->_mapcount);
|
first = atomic_inc_and_test(&page->_mapcount);
|
||||||
|
|
Loading…
Reference in New Issue