The patch titled Subject: dax-add-support-for-fsync-msync-v8 has been added to the -mm tree. Its filename is dax-add-support-for-fsync-msync-v8.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/dax-add-support-for-fsync-msync-v8.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/dax-add-support-for-fsync-msync-v8.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Ross Zwisler <ross.zwisler@xxxxxxxxxxxxxxx> Subject: dax-add-support-for-fsync-msync-v8 2) Add a check to dax_radix_entry() so that we WARN_ON_ONCE() and exit gracefully if we find a page cache entry still in the radix tree when trying to insert a DAX entry. Signed-off-by: Ross Zwisler <ross.zwisler@xxxxxxxxxxxxxxx> Cc: Jan Kara <jack@xxxxxxxx> Cc: Matthew Wilcox <willy@xxxxxxxxxxxxxxx> Cc: Dan Williams <dan.j.williams@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/dax.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff -puN fs/dax.c~dax-add-support-for-fsync-msync-v8 fs/dax.c --- a/fs/dax.c~dax-add-support-for-fsync-msync-v8 +++ a/fs/dax.c @@ -331,7 +331,7 @@ static int dax_radix_entry(struct addres sector_t sector, bool pmd_entry, bool dirty) { struct radix_tree_root *page_tree = &mapping->page_tree; - int error = 0; + int type, error = 0; void *entry; __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); @@ -340,7 +340,14 @@ static int dax_radix_entry(struct addres entry = radix_tree_lookup(page_tree, index); if (entry) { - if (!pmd_entry || RADIX_DAX_TYPE(entry) == RADIX_DAX_PMD) + type = RADIX_DAX_TYPE(entry); + if (WARN_ON_ONCE(type != RADIX_DAX_PTE && + type != RADIX_DAX_PMD)) { + error = -EIO; + goto unlock; + } + + if (!pmd_entry || type == RADIX_DAX_PMD) goto dirty; radix_tree_delete(&mapping->page_tree, index); mapping->nrexceptional--; _ Patches currently in -mm which might be from ross.zwisler@xxxxxxxxxxxxxxx are mm-dax-fix-livelock-allow-dax-pmd-mappings-to-become-writeable.patch dax-fix-null-pointer-dereference-in-__dax_dbg.patch dax-fix-conversion-of-holes-to-pmds.patch pmem-add-wb_cache_pmem-to-the-pmem-api.patch pmem-add-wb_cache_pmem-to-the-pmem-api-v6.patch dax-support-dirty-dax-entries-in-radix-tree.patch dax-support-dirty-dax-entries-in-radix-tree-v6.patch mm-add-find_get_entries_tag.patch dax-add-support-for-fsync-sync.patch dax-add-support-for-fsync-sync-v6.patch dax-add-support-for-fsync-msync-v7.patch dax-add-support-for-fsync-msync-v8.patch ext2-call-dax_pfn_mkwrite-for-dax-fsync-msync.patch ext4-call-dax_pfn_mkwrite-for-dax-fsync-msync.patch xfs-call-dax_pfn_mkwrite-for-dax-fsync-msync.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html