diff options
| -rw-r--r-- | mm/khugepaged.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 55930cbed3fd..2c5fe4f7a0c6 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c | |||
| @@ -1399,7 +1399,15 @@ static void collapse_shmem(struct mm_struct *mm, | |||
| 1399 | */ | 1399 | */ |
| 1400 | VM_BUG_ON_PAGE(!PageLocked(page), page); | 1400 | VM_BUG_ON_PAGE(!PageLocked(page), page); |
| 1401 | VM_BUG_ON_PAGE(!PageUptodate(page), page); | 1401 | VM_BUG_ON_PAGE(!PageUptodate(page), page); |
| 1402 | VM_BUG_ON_PAGE(PageTransCompound(page), page); | 1402 | |
| 1403 | /* | ||
| 1404 | * If file was truncated then extended, or hole-punched, before | ||
| 1405 | * we locked the first page, then a THP might be there already. | ||
| 1406 | */ | ||
| 1407 | if (PageTransCompound(page)) { | ||
| 1408 | result = SCAN_PAGE_COMPOUND; | ||
| 1409 | goto out_unlock; | ||
| 1410 | } | ||
| 1403 | 1411 | ||
| 1404 | if (page_mapping(page) != mapping) { | 1412 | if (page_mapping(page) != mapping) { |
| 1405 | result = SCAN_TRUNCATED; | 1413 | result = SCAN_TRUNCATED; |
