mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
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 <[email protected]> Acked-by: Rik van Riel <[email protected]> Acked-by: Andrea Arcangeli <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
56c9cfb13c
commit
a850ea3037
1 changed files with 2 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue