Skip to content

Commit

Permalink
xfs: fix xfs_reflink_unshare usage of filemap_write_and_wait_range
Browse files Browse the repository at this point in the history
commit d4f74e1 upstream.

The final parameter of filemap_write_and_wait_range is the end of the
range to flush, not the length of the range to flush.

Fixes: 46afb06 ("xfs: only flush the unshared range in xfs_reflink_unshare")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Acked-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Darrick J. Wong authored and gregkh committed Jul 7, 2022
1 parent f874e16 commit 9203dfb
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 @@ -1503,7 +1503,8 @@ xfs_reflink_unshare(
if (error)
goto out;

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

Expand Down

0 comments on commit 9203dfb

Please sign in to comment.