Skip to content

Commit 94542ba

Browse files
committed
xfs: don't allocate COW extents when unsharing a hole
jira LE-3571 Rebuild_History Non-Buildable kernel-4.18.0-553.60.1.el8_10 commit-author Darrick J. Wong <[email protected]> commit b8c4076 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]> (cherry picked from commit b8c4076) Signed-off-by: Jonathan Maple <[email protected]>
1 parent f0f6771 commit 94542ba

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
@@ -673,7 +673,7 @@ imap_needs_cow(
673673
return false;
674674

675675
/* when zeroing we don't have to COW holes or unwritten extents */
676-
if (flags & IOMAP_ZERO) {
676+
if (flags & (IOMAP_UNSHARE | IOMAP_ZERO)) {
677677
if (!nimaps ||
678678
imap->br_startblock == HOLESTARTBLOCK ||
679679
imap->br_state == XFS_EXT_UNWRITTEN)

0 commit comments

Comments
 (0)