Skip to content

Commit f7a4874

Browse files
Darrick J. Wongbrauner
authored andcommitted
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: Darrick J. Wong <[email protected]> Link: https://lore.kernel.org/r/20241002150040.GB21853@frogsfrogsfrogs Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Brian Foster <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 1ca4169 commit f7a4874

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/iomap/buffered-io.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1321,7 +1321,7 @@ static loff_t iomap_unshare_iter(struct iomap_iter *iter)
13211321
return length;
13221322

13231323
/*
1324-
* Don't bother with holes or unwritten extents.
1324+
* Don't bother with delalloc reservations, holes or unwritten extents.
13251325
*
13261326
* Note that we use srcmap directly instead of iomap_iter_srcmap as
13271327
* unsharing requires providing a separate source map, and the presence
@@ -1330,6 +1330,7 @@ static loff_t iomap_unshare_iter(struct iomap_iter *iter)
13301330
* fork for XFS.
13311331
*/
13321332
if (iter->srcmap.type == IOMAP_HOLE ||
1333+
iter->srcmap.type == IOMAP_DELALLOC ||
13331334
iter->srcmap.type == IOMAP_UNWRITTEN)
13341335
return length;
13351336

0 commit comments

Comments
 (0)