Skip to content

Commit b8c4076

Browse files
Darrick J. Wongbrauner
authored andcommitted
xfs: don't allocate COW extents when unsharing a hole
It doesn't make sense to allocate a COW extent when unsharing a hole because holes cannot be shared. Fixes: 1f1397b ("xfs: don't allocate into the data fork for an unshare request") Signed-off-by: Darrick J. Wong <[email protected]> Link: https://lore.kernel.org/r/172796813277.1131942.5486112889531210260.stgit@frogsfrogsfrogs Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent a311a08 commit b8c4076

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/xfs/xfs_iomap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ imap_needs_cow(
707707
return false;
708708

709709
/* when zeroing we don't have to COW holes or unwritten extents */
710-
if (flags & IOMAP_ZERO) {
710+
if (flags & (IOMAP_UNSHARE | IOMAP_ZERO)) {
711711
if (!nimaps ||
712712
imap->br_startblock == HOLESTARTBLOCK ||
713713
imap->br_state == XFS_EXT_UNWRITTEN)

0 commit comments

Comments
 (0)