Skip to contentSkip to conversation

xfs: remove redundant ASSERT in __xfs_bunmapi

PATCH New [email protected] 1 participant 1 message Nov 27 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs: remove redundant ASSERT in __xfs_bunmapi

From: Jianyun Gao <[email protected]>

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")
---
 fs/xfs/libxfs/xfs_bmap.c | 1 -
 1 file changed, 1 deletion(-)
fs/xfs/libxfs/xfs_bmap.c +0 -1
index dcd5faf3428e..f2627ec2dd24 100644
@@ -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;
Signature · 1 line
2.34.1