public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/2] xfs: reflink should force the log out if mounted with wsync
Date: Fri, 3 Apr 2020 08:42:30 -0700	[thread overview]
Message-ID: <20200403154230.GN80283@magnolia> (raw)
In-Reply-To: <20200403125522.450299-2-hch@lst.de>

On Fri, Apr 03, 2020 at 02:55:22PM +0200, Christoph Hellwig wrote:
> Reflink should force the log out to disk if the filesystem was mounted
> with wsync, the same as most other operations in xfs.
> 
> Fixes: 3fc9f5e409319 ("xfs: remove xfs_reflink_remap_range")
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Seems like a cleaner implementation than the one I came up with,

Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  fs/xfs/xfs_file.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
> index 68e1cbb3cfcc..4b8bdecc3863 100644
> --- a/fs/xfs/xfs_file.c
> +++ b/fs/xfs/xfs_file.c
> @@ -1059,7 +1059,11 @@ xfs_file_remap_range(
>  
>  	ret = xfs_reflink_update_dest(dest, pos_out + len, cowextsize,
>  			remap_flags);
> +	if (ret)
> +		goto out_unlock;
>  
> +	if (mp->m_flags & XFS_MOUNT_WSYNC)
> +		xfs_log_force_inode(dest);
>  out_unlock:
>  	xfs_reflink_remap_unlock(file_in, file_out);
>  	if (ret)
> -- 
> 2.25.1
> 

  reply	other threads:[~2020-04-03 15:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-03 12:55 [PATCH 1/2] xfs: factor out a new xfs_log_force_inode helper Christoph Hellwig
2020-04-03 12:55 ` [PATCH 2/2] xfs: reflink should force the log out if mounted with wsync Christoph Hellwig
2020-04-03 15:42   ` Darrick J. Wong [this message]
2020-04-06 12:14   ` Brian Foster
2020-04-06 15:31     ` Darrick J. Wong
2020-04-06 16:04       ` Brian Foster
2020-04-06 16:22         ` Darrick J. Wong
2020-04-03 15:42 ` [PATCH 1/2] xfs: factor out a new xfs_log_force_inode helper Darrick J. Wong
2020-04-06 12:13 ` Brian Foster

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=20200403154230.GN80283@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=hch@lst.de \
    --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