]> Git Repo - linux.git/commit - mm/khugepaged.c
mm/khugepaged: collapse_shmem() do not crash on Compound
authorHugh Dickins <[email protected]>
Fri, 30 Nov 2018 22:10:47 +0000 (14:10 -0800)
committerLinus Torvalds <[email protected]>
Fri, 30 Nov 2018 22:56:15 +0000 (14:56 -0800)
commit06a5e1268a5fb9c2b346a3da6b97e85f2eba0f07
treea2ccdfe76f11e07f2538884cb9c607cc90079492
parent87c460a0bded56195b5eb497d44709777ef7b415
mm/khugepaged: collapse_shmem() do not crash on Compound

collapse_shmem()'s VM_BUG_ON_PAGE(PageTransCompound) was unsafe: before
it holds page lock of the first page, racing truncation then extension
might conceivably have inserted a hugepage there already.  Fail with the
SCAN_PAGE_COMPOUND result, instead of crashing (CONFIG_DEBUG_VM=y) or
otherwise mishandling the unexpected hugepage - though later we might
code up a more constructive way of handling it, with SCAN_SUCCESS.

Link: http://lkml.kernel.org/r/[email protected]
Fixes: f3f0e1d2150b2 ("khugepaged: add support of collapse for tmpfs/shmem pages")
Signed-off-by: Hugh Dickins <[email protected]>
Cc: Kirill A. Shutemov <[email protected]>
Cc: Jerome Glisse <[email protected]>
Cc: Konstantin Khlebnikov <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: <[email protected]> [4.8+]
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/khugepaged.c
This page took 0.054337 seconds and 4 git commands to generate.