Skip to content

Commit

Permalink
xfs: only flush the unshared range in xfs_reflink_unshare
Browse files Browse the repository at this point in the history
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 <darrick.wong@oracle.com>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
  • Loading branch information
djwong committed Nov 5, 2020
1 parent c1f6b1a commit 46afb06
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/xfs/xfs_reflink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1502,7 +1502,8 @@ xfs_reflink_unshare(
&xfs_buffered_write_iomap_ops);
if (error)
goto out;
error = filemap_write_and_wait(inode->i_mapping);

error = filemap_write_and_wait_range(inode->i_mapping, offset, len);
if (error)
goto out;

Expand Down

0 comments on commit 46afb06

Please sign in to comment.