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>
This commit is contained in:
Christoph Hellwig 2019-10-19 09:09:42 -07:00 committed by Darrick J. Wong
parent 3f8a4f1d87
commit 0d45e3a208

View File

@ -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;