xfs: fix xfs_reflink_unshare usage of filemap_write_and_wait_range
PATCH 1/1 xfs: fix xfs_reflink_unshare usage of filemap_write_and_wait_range
From: Darrick J. Wong <[email protected]>
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 46afb0628b86 ("xfs: only flush the unshared range in xfs_reflink_unshare")
Signed-off-by Darrick J. Wong <[email protected]>
--- fs/xfs/xfs_reflink.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/xfs/xfs_reflink.c +2 -1
@@ -1522,7 +1522,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;
Quoted 5 lines · Darrick J. Wong
From: Darrick J. Wong <[email protected]>
The final parameter of
filemap_write_and_wait_rangeis the end of the range to flush, not the length of the range to flush.
Looks good to me.
Reviewed-by Chandan Babu R <[email protected]>
Quoted 20 lines
Fixes 46afb0628b86 ("xfs: only flush the unshared range in xfs_reflink_unshare")Signed-off-by Darrick J. Wong <[email protected]>--- fs/xfs/xfs_reflink.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)fs/xfs/xfs_reflink.c +2
-1@@ -1522,7 +1522,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;
Signature · 1 line
chandan
Quoted 8 lines · Darrick J. Wong
From: Darrick J. Wong <[email protected]>
The final parameter of
filemap_write_and_wait_rangeis the end of the range to flush, not the length of the range to flush.Fixes 46afb0628b86 ("xfs: only flush the unshared range in xfs_reflink_unshare")Signed-off-by Darrick J. Wong <[email protected]>---
Reviewed-by Brian Foster <[email protected]>
Quoted 18 lines
fs/xfs/xfs_reflink.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)fs/xfs/xfs_reflink.c +2
-1@@ -1522,7 +1522,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;