From: Christoph Hellwig Date: Sat, 19 Oct 2019 16:09:42 +0000 (-0700) Subject: xfs: also call xfs_file_iomap_end_delalloc for zeroing operations X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0d45e3a2082225ad8e8b211b7f00ee9bb99ea748;p=linux.git 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 Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index 95719e161286c..f1d32bcf48bdf 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;