• Jan Kara's avatar
    mm: Fix warning in insert_pfn() · f2c57d91
    Jan Kara authored
    In DAX mode a write pagefault can race with write(2) in the following
    way:
    
    CPU0                            CPU1
                                    write fault for mapped zero page (hole)
    dax_iomap_rw()
      iomap_apply()
        xfs_file_iomap_begin()
          - allocates blocks
        dax_iomap_actor()
          invalidate_inode_pages2_range()
            - invalidates radix tree entries in given range
                                    dax_iomap_pte_fault()
                                      grab_mapping_entry()
                                        - no entry found, creates empty
                                      ...
                                      xfs_file_iomap_begin()
                                        - finds already allocated block
                                      ...
                                      vmf_insert_mixed_mkwrite()
                                        - WARNs and does nothing because there
                                          is still zero page mapped in PTE
            unmap_mappi...
    f2c57d91
memory.c 123 KB