Commit 0d45e3a2 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Darrick J. Wong

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent 3f8a4f1d
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment