1 ext4: allow DAX writeback for hole punch
3 From: Ross Zwisler <ross.zwisler@linux.intel.com>
5 Currently when doing a DAX hole punch with ext4 we fail to do a writeback.
6 This is because the logic around filemap_write_and_wait_range() in
7 ext4_punch_hole() only looks for dirty page cache pages in the radix tree,
8 not for dirty DAX exceptional entries.
10 Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
11 Reviewed-by: Jan Kara <jack@suse.cz>
12 Cc: <stable@vger.kernel.org>
13 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 fs/ext4/inode.c | 4 ++--
16 1 file changed, 2 insertions(+), 2 deletions(-)
18 diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
19 index 3131747..0900cb4 100644
22 @@ -3890,7 +3890,7 @@ int ext4_update_disksize_before_punch(struct inode *inode, loff_t offset,
26 - * ext4_punch_hole: punches a hole in a file by releaseing the blocks
27 + * ext4_punch_hole: punches a hole in a file by releasing the blocks
28 * associated with the given offset and length
31 @@ -3919,7 +3919,7 @@ int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length)
32 * Write out all dirty pages to avoid race conditions
35 - if (mapping->nrpages && mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) {
36 + if (mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) {
37 ret = filemap_write_and_wait_range(mapping, offset,