summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-10-19 09:09:42 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2019-10-21 09:04:58 -0700
commit0d45e3a2082225ad8e8b211b7f00ee9bb99ea748 (patch)
tree0c141b4d7bba7dc33873a292d408101610c0e05c
parent3f8a4f1d876d3e3e49e50b0396eaffcc4ba71b08 (diff)
xfs: also call xfs_file_iomap_end_delalloc for zeroing operations
There is no reason not to punch out stale delalloc blocks for zeroing operations, as they otherwise behave exactly like normal writes. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-rw-r--r--fs/xfs/xfs_iomap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index 95719e161286..f1d32bcf48bd 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -1145,7 +1145,8 @@ xfs_file_iomap_end(
unsigned flags,
struct iomap *iomap)
{
- if ((flags & IOMAP_WRITE) && iomap->type == IOMAP_DELALLOC)
+ if ((flags & (IOMAP_WRITE | IOMAP_ZERO)) &&
+ iomap->type == IOMAP_DELALLOC)
return xfs_file_iomap_end_delalloc(XFS_I(inode), offset,
length, written, iomap);
return 0;