]> git.baikalelectronics.ru Git - kernel.git/commit
mm: new_vma_page() cannot see NULL vma for hugetlb pages
authorMichal Hocko <mhocko@suse.cz>
Thu, 23 Jan 2014 23:53:15 +0000 (15:53 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 24 Jan 2014 00:36:52 +0000 (16:36 -0800)
commit8ab80ed20eb0e3b9ad1435e3ceeaf8f790956952
tree8e103fa5bfea059f1ace38d205a09e42e19dd6db
parent26e4323d532c91fe03717c200ed6c5970e5d0869
mm: new_vma_page() cannot see NULL vma for hugetlb pages

Commit 260d38a6507e ("mm/mempolicy: fix !vma in new_vma_page()") has
removed BUG_ON(!vma) from new_vma_page which is partially correct
because page_address_in_vma will return EFAULT for non-linear mappings
and at least shared shmem might be mapped this way.

The patch also tried to prevent NULL ptr for hugetlb pages which is not
correct AFAICS because hugetlb pages cannot be mapped as VM_NONLINEAR
and other conditions in page_address_in_vma seem to be legit and catch
real bugs.

This patch restores BUG_ON for PageHuge to catch potential issues when
the to-be-migrated page is not setup properly.

Signed-off-by: Michal Hocko <mhocko@suse.cz>
Reviewed-by: Bob Liu <bob.liu@oracle.com>
Cc: Sasha Levin <sasha.levin@oracle.com>
Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/mempolicy.c