public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Chandan Babu R <chandanrlinux@gmail.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] xfs: only flush the unshared range in xfs_reflink_unshare
Date: Wed, 04 Nov 2020 15:07:22 +0530	[thread overview]
Message-ID: <1998006.DMGvZ8J8Fo@garuda> (raw)
In-Reply-To: <20201103183733.GI7123@magnolia>

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

> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  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




      reply	other threads:[~2020-11-04  9:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-03 18:37 [PATCH] xfs: only flush the unshared range in xfs_reflink_unshare Darrick J. Wong
2020-11-04  9:37 ` Chandan Babu R [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1998006.DMGvZ8J8Fo@garuda \
    --to=chandanrlinux@gmail.com \
    --cc=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox