Skip to content

Commit 46afb06

Browse files
committed
xfs: only flush the unshared range in xfs_reflink_unshare
There's no reason to flush an entire file when we're unsharing part of a file. Therefore, only initiate writeback on the selected range. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Chandan Babu R <[email protected]>
1 parent c1f6b1a commit 46afb06

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/xfs/xfs_reflink.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1502,7 +1502,8 @@ xfs_reflink_unshare(
15021502
&xfs_buffered_write_iomap_ops);
15031503
if (error)
15041504
goto out;
1505-
error = filemap_write_and_wait(inode->i_mapping);
1505+
1506+
error = filemap_write_and_wait_range(inode->i_mapping, offset, len);
15061507
if (error)
15071508
goto out;
15081509

0 commit comments

Comments
 (0)