public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org, edwin@etorok.net
Subject: Re: [PATCH 2/3] xfs: fix xfs_reflink_remap_prep calling conventions
Date: Wed, 24 Jun 2020 08:38:49 -0400	[thread overview]
Message-ID: <20200624123849.GB9914@bfoster> (raw)
In-Reply-To: <159288490208.150128.2169762955647750917.stgit@magnolia>

On Mon, Jun 22, 2020 at 09:01:42PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Fix the return value of xfs_reflink_remap_prep so that its return value
> conventions match the rest of xfs.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/xfs_file.c    |    2 +-
>  fs/xfs/xfs_reflink.c |    6 +++---
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> 
> diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
> index 00db81eac80d..b375fae811f2 100644
> --- a/fs/xfs/xfs_file.c
> +++ b/fs/xfs/xfs_file.c
> @@ -1035,7 +1035,7 @@ xfs_file_remap_range(
>  	/* Prepare and then clone file data. */
>  	ret = xfs_reflink_remap_prep(file_in, pos_in, file_out, pos_out,
>  			&len, remap_flags);
> -	if (ret < 0 || len == 0)
> +	if (ret || len == 0)
>  		return ret;
>  
>  	trace_xfs_reflink_remap_range(src, pos_in, len, dest, pos_out);
> diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
> index f50a8c2f21a5..dd9ed7d5694d 100644
> --- a/fs/xfs/xfs_reflink.c
> +++ b/fs/xfs/xfs_reflink.c
> @@ -1341,7 +1341,7 @@ xfs_reflink_remap_prep(
>  	struct inode		*inode_out = file_inode(file_out);
>  	struct xfs_inode	*dest = XFS_I(inode_out);
>  	bool			same_inode = (inode_in == inode_out);
> -	ssize_t			ret;
> +	int			ret;
>  
>  	/* Lock both files against IO */
>  	ret = xfs_iolock_two_inodes_and_break_layout(inode_in, inode_out);
> @@ -1365,7 +1365,7 @@ xfs_reflink_remap_prep(
>  
>  	ret = generic_remap_file_range_prep(file_in, pos_in, file_out, pos_out,
>  			len, remap_flags);
> -	if (ret < 0 || *len == 0)
> +	if (ret || *len == 0)
>  		goto out_unlock;
>  
>  	/* Attach dquots to dest inode before changing block map */
> @@ -1400,7 +1400,7 @@ xfs_reflink_remap_prep(
>  	if (ret)
>  		goto out_unlock;
>  
> -	return 1;
> +	return 0;
>  out_unlock:
>  	xfs_reflink_remap_unlock(file_in, file_out);
>  	return ret;
> 


  reply	other threads:[~2020-06-24 12:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23  4:01 [PATCH 0/3] xfs: reflink cleanups Darrick J. Wong
2020-06-23  4:01 ` [PATCH 1/3] xfs: redesign the reflink remap loop to fix blkres depletion crash Darrick J. Wong
2020-06-24 12:38   ` Brian Foster
2020-06-24 15:09     ` Darrick J. Wong
2020-06-24 17:07       ` Darrick J. Wong
2020-06-24 18:16         ` Brian Foster
2020-06-24 18:35           ` Darrick J. Wong
2020-06-24 18:45             ` Brian Foster
2020-06-23  4:01 ` [PATCH 2/3] xfs: fix xfs_reflink_remap_prep calling conventions Darrick J. Wong
2020-06-24 12:38   ` Brian Foster [this message]
2020-06-23  4:01 ` [PATCH 3/3] xfs: refactor locking and unlocking two inodes against userspace IO Darrick J. Wong
2020-06-24 12:39   ` 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=20200624123849.GB9914@bfoster \
    --to=bfoster@redhat.com \
    --cc=darrick.wong@oracle.com \
    --cc=edwin@etorok.net \
    --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