Re: [PATCH] xfs: remove redundant ASSERT in __xfs_bunmapi

From: Christoph Hellwig

Date: Mon Nov 30 2026 - 08:28:38 EST


On Fri, Nov 27, 2026 at 04:40:16PM +0800, jianyungao89@xxxxxxxxx wrote:
> From: Jianyun Gao <jianyungao89@xxxxxxxxx>
>
> 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.