Commit f7a4874d authored by Darrick J. Wong's avatar Darrick J. Wong Committed by Christian Brauner

iomap: don't bother unsharing delalloc extents

If unshare encounters a delalloc reservation in the srcmap, that means
that the file range isn't shared because delalloc reservations cannot be
reflinked.  Therefore, don't try to unshare them.
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/20241002150040.GB21853@frogsfrogsfrogsReviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 1ca4169c
...@@ -1321,7 +1321,7 @@ static loff_t iomap_unshare_iter(struct iomap_iter *iter) ...@@ -1321,7 +1321,7 @@ static loff_t iomap_unshare_iter(struct iomap_iter *iter)
return length; return length;
/* /*
* Don't bother with holes or unwritten extents. * Don't bother with delalloc reservations, holes or unwritten extents.
* *
* Note that we use srcmap directly instead of iomap_iter_srcmap as * Note that we use srcmap directly instead of iomap_iter_srcmap as
* unsharing requires providing a separate source map, and the presence * unsharing requires providing a separate source map, and the presence
...@@ -1330,6 +1330,7 @@ static loff_t iomap_unshare_iter(struct iomap_iter *iter) ...@@ -1330,6 +1330,7 @@ static loff_t iomap_unshare_iter(struct iomap_iter *iter)
* fork for XFS. * fork for XFS.
*/ */
if (iter->srcmap.type == IOMAP_HOLE || if (iter->srcmap.type == IOMAP_HOLE ||
iter->srcmap.type == IOMAP_DELALLOC ||
iter->srcmap.type == IOMAP_UNWRITTEN) iter->srcmap.type == IOMAP_UNWRITTEN)
return length; return length;
......
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