|
@@ -686,7 +686,17 @@ int invalidate_inode_pages2_range(struct address_space *mapping,
|
|
|
cond_resched();
|
|
|
index++;
|
|
|
}
|
|
|
-
|
|
|
+ /*
|
|
|
+ * For DAX we invalidate page tables after invalidating radix tree. We
|
|
|
+ * could invalidate page tables while invalidating each entry however
|
|
|
+ * that would be expensive. And doing range unmapping before doesn't
|
|
|
+ * work as we have no cheap way to find whether radix tree entry didn't
|
|
|
+ * get remapped later.
|
|
|
+ */
|
|
|
+ if (dax_mapping(mapping)) {
|
|
|
+ unmap_mapping_range(mapping, (loff_t)start << PAGE_SHIFT,
|
|
|
+ (loff_t)(end - start + 1) << PAGE_SHIFT, 0);
|
|
|
+ }
|
|
|
out:
|
|
|
cleancache_invalidate_inode(mapping);
|
|
|
return ret;
|