]> git.baikalelectronics.ru Git - kernel.git/commit
mm/memory-failure.c: catch unexpected -EFAULT from vma_address()
authorMiaohe Lin <linmiaohe@huawei.com>
Tue, 22 Mar 2022 21:44:15 +0000 (14:44 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 22 Mar 2022 22:57:07 +0000 (15:57 -0700)
commiteea3f877eca2e042b253683d989dc82636c2ce8e
tree8c5068f78c6c56643e28c1082d779e1b310d9baa
parent02f77c35adb1a6ccbfcbd031095d4e91a8fe79dd
mm/memory-failure.c: catch unexpected -EFAULT from vma_address()

It's unexpected to walk the page table when vma_address() return
-EFAULT.  But dev_pagemap_mapping_shift() is called only when vma
associated to the error page is found already in
collect_procs_{file,anon}, so vma_address() should not return -EFAULT
except with some bug, as Naoya pointed out.  We can use VM_BUG_ON_VMA()
to catch this bug here.

Link: https://lkml.kernel.org/r/20220218090118.1105-3-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memory-failure.c