Re: [PATCH] xfs: only flush the unshared range in xfs_reflink_unshare

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday 4 November 2020 12:07:33 AM IST Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> 
> 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.
>

Looks good to me.

Reviewed-by: Chandan Babu R <chandanrlinux@xxxxxxxxx>

> Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> ---
>  fs/xfs/xfs_reflink.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
> index 16098dc42add..6fa05fb78189 100644
> --- a/fs/xfs/xfs_reflink.c
> +++ b/fs/xfs/xfs_reflink.c
> @@ -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;
>  
> 


-- 
chandan






[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux