]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/ext2/inode.c
Merge tag 'xfs-for-linus-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[karo-tx-linux.git] / fs / ext2 / inode.c
index c7dbb4661119ef8d17ef61a975393a161fbf31aa..1e72d425fd3b2b96d5749c9a9130f63458474d73 100644 (file)
@@ -732,6 +732,16 @@ static int ext2_get_blocks(struct inode *inode,
        }
 
        if (IS_DAX(inode)) {
+               int i;
+
+               /*
+                * We must unmap blocks before zeroing so that writeback cannot
+                * overwrite zeros with stale data from block device page cache.
+                */
+               for (i = 0; i < count; i++) {
+                       unmap_underlying_metadata(inode->i_sb->s_bdev,
+                                       le32_to_cpu(chain[depth-1].key) + i);
+               }
                /*
                 * block must be initialised before we put it in the tree
                 * so that it's not found by another thread before it's