From: Dave Chinner <david@fromorbit.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org, bfoster@redhat.com
Subject: Re: [PATCH 3/4] xfs: don't return _QUERY_ABORT from xfs_rmap_has_other_keys
Date: Tue, 27 Aug 2019 09:15:22 +1000 [thread overview]
Message-ID: <20190826231522.GO1119@dread.disaster.area> (raw)
In-Reply-To: <156685614244.2853532.3739810624053899109.stgit@magnolia>
On Mon, Aug 26, 2019 at 02:49:02PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> The xfs_rmap_has_other_keys helper aborts the iteration as soon as it
> has an answer. Don't let this abort leak out to callers.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
> fs/xfs/libxfs/xfs_rmap.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
>
> diff --git a/fs/xfs/libxfs/xfs_rmap.c b/fs/xfs/libxfs/xfs_rmap.c
> index e6aeb390b2fb..819693ef852c 100644
> --- a/fs/xfs/libxfs/xfs_rmap.c
> +++ b/fs/xfs/libxfs/xfs_rmap.c
> @@ -2540,8 +2540,11 @@ xfs_rmap_has_other_keys(
>
> error = xfs_rmap_query_range(cur, &low, &high,
> xfs_rmap_has_other_keys_helper, &rks);
> + if (error < 0)
> + return error;
> +
> *has_rmap = rks.has_rmap;
> - return error;
> + return 0;
> }
Yup, makes sense - XFS_BTREE_QUERY_RANGE_ABORT has a positive value,
so this makes success have a return value of 0 and that fixes
the spurious error detection in xrep_reap_block().
Reviewed-by: Dave Chinner <dchinner@redhat.com>
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2019-08-26 23:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-26 21:48 [PATCH 0/4] xfs: fixes for 5.4 Darrick J. Wong
2019-08-26 21:48 ` [PATCH 1/4] xfs: bmap scrub should only scrub records once Darrick J. Wong
2019-08-26 23:08 ` Dave Chinner
2019-08-27 13:14 ` Brian Foster
2019-08-27 15:18 ` Darrick J. Wong
2019-08-27 15:21 ` Brian Foster
2019-08-28 16:01 ` Darrick J. Wong
2019-08-26 21:48 ` [PATCH 2/4] xfs: fix maxicount division by zero error Darrick J. Wong
2019-08-26 23:09 ` Dave Chinner
2019-08-26 21:49 ` [PATCH 3/4] xfs: don't return _QUERY_ABORT from xfs_rmap_has_other_keys Darrick J. Wong
2019-08-26 23:15 ` Dave Chinner [this message]
2019-08-26 21:49 ` [PATCH 4/4] xfs: fix sign handling problem in xfs_bmbt_diff_two_keys Darrick J. Wong
2019-08-26 23:15 ` Dave Chinner
2019-08-27 13:01 ` Eric Sandeen
2019-08-27 15:19 ` Darrick J. Wong
2019-08-27 15:20 ` Eric Sandeen
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=20190826231522.GO1119@dread.disaster.area \
--to=david@fromorbit.com \
--cc=bfoster@redhat.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;
as well as URLs for NNTP newsgroup(s).