aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dax.h
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2016-05-12 18:29:15 +0200
committerRoss Zwisler <ross.zwisler@linux.intel.com>2016-05-19 15:13:17 -0600
commit348e967ab07c96a9e7a6a194812254a8df2045c0 (patch)
tree2f593288ff249a8b496a5b04c0bdfcc61ab71adc /include/linux/dax.h
parentdax: Fix condition for filling of PMD holes (diff)
downloadlinux-dev-348e967ab07c96a9e7a6a194812254a8df2045c0.tar.xz
linux-dev-348e967ab07c96a9e7a6a194812254a8df2045c0.zip
dax: Make huge page handling depend of CONFIG_BROKEN
Currently the handling of huge pages for DAX is racy. For example the following can happen: CPU0 (THP write fault) CPU1 (normal read fault) __dax_pmd_fault() __dax_fault() get_block(inode, block, &bh, 0) -> not mapped get_block(inode, block, &bh, 0) -> not mapped if (!buffer_mapped(&bh) && write) get_block(inode, block, &bh, 1) -> allocates blocks truncate_pagecache_range(inode, lstart, lend); dax_load_hole(); This results in data corruption since process on CPU1 won't see changes into the file done by CPU0. The race can happen even if two normal faults race however with THP the situation is even worse because the two faults don't operate on the same entries in the radix tree and we want to use these entries for serialization. So make THP support in DAX code depend on CONFIG_BROKEN for now. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Diffstat (limited to 'include/linux/dax.h')
-rw-r--r--include/linux/dax.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/dax.h b/include/linux/dax.h
index 90fbc99e5313..72dc81de3ddb 100644
--- a/include/linux/dax.h
+++ b/include/linux/dax.h
@@ -29,7 +29,7 @@ static inline int __dax_zero_page_range(struct block_device *bdev,
}
#endif
-#ifdef CONFIG_TRANSPARENT_HUGEPAGE
+#if defined(CONFIG_TRANSPARENT_HUGEPAGE)
int dax_pmd_fault(struct vm_area_struct *, unsigned long addr, pmd_t *,
unsigned int flags, get_block_t);
int __dax_pmd_fault(struct vm_area_struct *, unsigned long addr, pmd_t *,