• M
    dax: Fix huge page faults · 0e40de03
    Matthew Wilcox 提交于
    Using xas_load() with a PMD-sized xa_state would work if either a
    PMD-sized entry was present or a PTE sized entry was present in the
    first 64 entries (of the 512 PTEs in a PMD on x86).  If there was no
    PTE in the first 64 entries, grab_mapping_entry() would believe there
    were no entries present, allocate a PMD-sized entry and overwrite the
    PTE in the page cache.
    
    Use xas_find_conflict() instead which turns out to simplify
    both get_unlocked_entry() and grab_mapping_entry().  Also remove a
    WARN_ON_ONCE from grab_mapping_entry() as it will have already triggered
    in get_unlocked_entry().
    
    Fixes: cfc93c6c ("dax: Convert dax_insert_pfn_mkwrite to XArray")
    Signed-off-by: NMatthew Wilcox <willy@infradead.org>
    0e40de03
dax.c 45.0 KB