From: "Darrick J. Wong" <djwong@kernel.org>
To: Eric Sandeen <sandeen@redhat.com>
Cc: linux-xfs@vger.kernel.org, cem@kernel.org, hch@lst.de, dgc@kernel.org
Subject: Re: [PATCH 4/8] xfs: remove redundant stat check after rcbagbt_insert()
Date: Fri, 16 Oct 2026 12:45:58 -0700 [thread overview]
Message-ID: <20261016194558.GF107986@frogsfrogsfrogs> (raw)
In-Reply-To: <20261016193422.1630907-5-sandeen@redhat.com>
On Fri, Oct 16, 2026 at 02:29:04PM -0500, Eric Sandeen wrote:
> rcbagbt_insert() simply returns the error and status from
> xfs_btree_insert, which has already validated the insert
> or returned an error.
>
> This makes this instance of this idiom:
>
> error = rcbagbt_insert(cur, &bagrec, &has);
> if (error)
> goto out_cur;
> if (!has) {
> error = -EFSCORRUPTED;
> goto out_cur;
> }
>
> unnecessary/unreachable code. Remove it.
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
--D
> ---
> fs/xfs/scrub/rcbag.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/fs/xfs/scrub/rcbag.c b/fs/xfs/scrub/rcbag.c
> index 8f3a10f7c908..fd9ccb205725 100644
> --- a/fs/xfs/scrub/rcbag.c
> +++ b/fs/xfs/scrub/rcbag.c
> @@ -105,10 +105,6 @@ rcbag_add(
> error = rcbagbt_insert(cur, &bagrec, &has);
> if (error)
> goto out_cur;
> - if (!has) {
> - error = -EFSCORRUPTED;
> - goto out_cur;
> - }
> }
>
> xfs_btree_del_cursor(cur, 0);
> --
> 2.55.0
>
>
next prev parent reply other threads:[~2026-10-16 19:45 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 19:29 [PATCH 0/8] xfs: consolidate btree insert/delete checks Eric Sandeen
2026-10-16 19:29 ` [PATCH 1/8] xfs: remove redundant stat checks after xfs_btree_insert() Eric Sandeen
2026-10-16 19:44 ` Darrick J. Wong
2026-10-16 19:29 ` [PATCH 2/8] xfs: remove redundant stat checks after xfs_refcount_insert() Eric Sandeen
2026-10-16 19:44 ` Darrick J. Wong
2026-10-16 19:29 ` [PATCH 3/8] xfs: remove redundant stat checks after xfs_inobt_insert_rec() Eric Sandeen
2026-10-16 19:45 ` Darrick J. Wong
2026-10-16 19:29 ` [PATCH 4/8] xfs: remove redundant stat check after rcbagbt_insert() Eric Sandeen
2026-10-16 19:45 ` Darrick J. Wong [this message]
2026-10-16 19:29 ` [PATCH 5/8] xfs: remove status parameter from several btree insert functions Eric Sandeen
2026-10-16 19:46 ` Darrick J. Wong
2026-10-16 19:29 ` [PATCH 6/8] xfs: add stat check to xfs_btree_delete and remove caller checks Eric Sandeen
2026-10-16 19:47 ` Darrick J. Wong
2026-10-16 19:29 ` [PATCH 7/8] xfs: remove redundant stat checks after xfs_refcount_delete() Eric Sandeen
2026-10-16 19:47 ` Darrick J. Wong
2026-10-16 19:29 ` [PATCH 8/8] xfs: remove status parameter from two btree delete functions Eric Sandeen
2026-10-16 19:47 ` Darrick J. Wong
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=20261016194558.GF107986@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=cem@kernel.org \
--cc=dgc@kernel.org \
--cc=hch@lst.de \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.