mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: jianyungao89@gmail.com
To: linux-xfs@vger.kernel.org
Cc: cem@kernel.org, djwong@kernel.org, sandeen@redhat.com,
	bfoster@redhat.com, ast@kernel.org, ishiyama@hpc.is.uec.ac.jp,
	linux-kernel@vger.kernel.org,
	Jianyun Gao <jianyungao89@gmail.com>
Subject: [PATCH] xfs: remove redundant ASSERT in __xfs_bunmapi
Date: Fri, 27 Nov 2026 16:40:16 +0800	[thread overview]
Message-ID: <20261127084016.18418-1-jianyungao89@gmail.com> (raw)

From: Jianyun Gao <jianyungao89@gmail.com>

In __xfs_bunmapi(), the code checks if the fork is in btree format and
then immediately asserts the same condition:

    if (ifp->if_format == XFS_DINODE_FMT_BTREE) {
        ASSERT(ifp->if_format == XFS_DINODE_FMT_BTREE);
        cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);

The ASSERT was originally meaningful when the if-condition tested a
different property (the XFS_IFBROOT flag), serving as a cross-check
that IFBROOT implies BTREE format.  commit ac1e067211d14 ("xfs: remove
XFS_IFBROOT") replaced the flag check with a direct format comparison,
making the ASSERT tautological.  Remove it.

Fixes: ac1e067211d14 ("xfs: remove XFS_IFBROOT")
Signed-off-by: Jianyun Gao <jianyungao89@gmail.com>
---
 fs/xfs/libxfs/xfs_bmap.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index dcd5faf3428e..f2627ec2dd24 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -5166,7 +5166,6 @@ __xfs_bunmapi(
 
 	logflags = 0;
 	if (ifp->if_format == XFS_DINODE_FMT_BTREE) {
-		ASSERT(ifp->if_format == XFS_DINODE_FMT_BTREE);
 		cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
 	} else
 		cur = NULL;
-- 
2.34.1


                 reply	other threads:[~2026-11-27  8:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261127084016.18418-1-jianyungao89@gmail.com \
    --to=jianyungao89@gmail.com \
    --cc=ast@kernel.org \
    --cc=bfoster@redhat.com \
    --cc=cem@kernel.org \
    --cc=djwong@kernel.org \
    --cc=ishiyama@hpc.is.uec.ac.jp \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®