mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-04-13 09:59:31 +00:00
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: 1f1397b721
("xfs: don't allocate into the data fork for an unshare request")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/172796813277.1131942.5486112889531210260.stgit@frogsfrogsfrogs
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
a311a08a42
commit
b8c4076db5
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue