mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: jianyungao89@gmail.com
Cc: linux-xfs@vger.kernel.org, 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
Subject: Re: [PATCH] xfs: remove redundant ASSERT in __xfs_bunmapi
Date: Mon, 30 Nov 2026 05:28:19 -0800	[thread overview]
Message-ID: <aw158wxijBtl9zL6@infradead.org> (raw)
In-Reply-To: <20261127084016.18418-1-jianyungao89@gmail.com>

On Fri, Nov 27, 2026 at 04:40:16PM +0800, jianyungao89@gmail.com wrote:
> 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")

The change looks good, but this is a lot of text for a trivial fix.
And the Fixes tag does not belong here - nothing is fixed here, this
just removed a little bit of redundant code.


      reply	other threads:[~2026-11-30 13:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27  8:40 jianyungao89
2026-11-30 13:28 ` Christoph Hellwig [this message]

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=aw158wxijBtl9zL6@infradead.org \
    --to=hch@infradead.org \
    --cc=ast@kernel.org \
    --cc=bfoster@redhat.com \
    --cc=cem@kernel.org \
    --cc=djwong@kernel.org \
    --cc=ishiyama@hpc.is.uec.ac.jp \
    --cc=jianyungao89@gmail.com \
    --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®