Message ID | 172796813277.1131942.5486112889531210260.stgit@frogsfrogsfrogs (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [1/4] xfs: don't allocate COW extents when unsharing a hole | expand |
On Thu, Oct 03, 2024 at 08:09:01AM -0700, Darrick J. Wong wrote: > From: Darrick J. Wong <djwong@kernel.org> > > It doesn't make sense to allocate a COW extent when unsharing a hole > because holes cannot be shared. > > Fixes: 1f1397b7218d7 ("xfs: don't allocate into the data fork for an unshare request") Looks good: Reviewed-by: Christoph Hellwig <hch@lst.de>
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index 1e11f48814c0..dc0443848485 100644 --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c @@ -707,7 +707,7 @@ imap_needs_cow( return false; /* when zeroing we don't have to COW holes or unwritten extents */ - if (flags & IOMAP_ZERO) { + if (flags & (IOMAP_UNSHARE | IOMAP_ZERO)) { if (!nimaps || imap->br_startblock == HOLESTARTBLOCK || imap->br_state == XFS_EXT_UNWRITTEN)