add patch create-function-to-read-journal-inode
[ext4-patch-queue.git] / allow-dax-writeback-for-hole-punch
blobd28401d193659c6df8855f923a84091c9312077f
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>
14 ---
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
20 --- a/fs/ext4/inode.c
21 +++ b/fs/ext4/inode.c
22 @@ -3890,7 +3890,7 @@ int ext4_update_disksize_before_punch(struct inode *inode, loff_t offset,
23  }
25  /*
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
29   *
30   * @inode:  File inode
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
33          * Then release them.
34          */
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,
38                                                    offset + length - 1);
39                 if (ret)
40 -- 
41 2.9.0