Skip to content
  • Ken Chen's avatar
    [PATCH] hugetlb: preserve hugetlb pte dirty state · 6649a386
    Ken Chen authored
    __unmap_hugepage_range() is buggy that it does not preserve dirty state of
    huge_pte when unmapping hugepage range.  It causes data corruption in the
    event of dop_caches being used by sys admin.  For example, an application
    creates a hugetlb file, modify pages, then unmap it.  While leaving the
    hugetlb file alive, comes along sys admin doing a "echo 3 >
    drop_pagecache_sb() will happily free all pages that aren't marked dirty if
    there are no active mapping.  Later when application remaps the hugetlb
    file back and all data are gone, triggering catastrophic flip over on
    Not only that, the internal resv_huge_pages count will also get all messed
    up.  Fix it up by marking page dirty appropriately.
    Signed-off-by: default avatarKen Chen <>
    Cc: "Nish Aravamudan" <>
    Cc: Adam Litke <>
    Cc: David Gibson <>
    Cc: William Lee Irwin III <>
    Cc: <>
    Cc: Hugh Dickins <>
    Signed-off-by: default avatarAndrew Morton <>
    Signed-off-by: default avatarLinus Torvalds <>