Skip to contentSkip to conversation

libxfs: Remove pointless crc flag check from xfs_agfl_verify

PATCH In review [email protected] 2 participants 3 messages Jan 16, 2025 XFS filesystem

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 libxfs: Remove pointless crc flag check from xfs_agfl_verify

From: Carlos Maiolino <[email protected]>

Just a small clean up.
xfs_agfl_verify() is only called from xfs_agfl_{read,write}_verify() helpers.
Both of them already check if crc is enabled, there seems to be no reason for checking for it again.

---
 fs/xfs/libxfs/xfs_alloc.c | 3 ---
 1 file changed, 3 deletions(-)
fs/xfs/libxfs/xfs_alloc.c +0 -3
index 3d33e17f2e5c..619e6d6570f8 100644
@@ -787,9 +787,6 @@ xfs_agfl_verify(
 	__be32		*agfl_bno = xfs_buf_to_agfl_bno(bp);
 	int		i;
 
-	if (!xfs_has_crc(mp))
-		return NULL;
-
 	if (!xfs_verify_magic(bp, agfl->agfl_magicnum))
 		return __this_address;
 	if (!uuid_equal(&agfl->agfl_uuid, &mp->m_sb.sb_meta_uuid))
Signature · 1 line
2.47.1
#1 lore raw
Quoted 7 lines · On Thu, Jan 16, 2025 at 05:32:56PM +0100, [email protected] wrote:

From: Carlos Maiolino <[email protected]>

Just a small clean up.
xfs_agfl_verify() is only called from xfs_agfl_{read,write}_verify() helpers.
Both of them already check if crc is enabled, there seems to be no reason for checking for it again.

...but it does get called via ->verify_struct, which in turn is called by online fsck and buffer log item "precommit" if CONFIG_XFS_DEBUG_EXPENSIVE=y, so please don't remove this check.

--D

Quoted 23 lines
---
 fs/xfs/libxfs/xfs_alloc.c | 3 ---
 1 file changed, 3 deletions(-)
fs/xfs/libxfs/xfs_alloc.c +0 -3
index 3d33e17f2e5c..619e6d6570f8 100644
@@ -787,9 +787,6 @@ xfs_agfl_verify(
 	__be32		*agfl_bno = xfs_buf_to_agfl_bno(bp);
 	int		i;
 
-	if (!xfs_has_crc(mp))
-		return NULL;
-
 	if (!xfs_verify_magic(bp, agfl->agfl_magicnum))
 		return __this_address;
 	if (!uuid_equal(&agfl->agfl_uuid, &mp->m_sb.sb_meta_uuid))
Signature · 1 line
2.47.1
author maintainer
#2 lore raw
Quoted 9 lines · Darrick J. Wong
Quoted 7 lines · On Thu, Jan 16, 2025 at 05:32:56PM +0100, [email protected] wrote:

From: Carlos Maiolino <[email protected]>

Just a small clean up.
xfs_agfl_verify() is only called from xfs_agfl_{read,write}_verify() helpers.
Both of them already check if crc is enabled, there seems to be no reason for checking for it again.

Quoted 3 lines

...but it does get called via ->verify_struct, which in turn is called by online fsck and buffer log item "precommit" if CONFIG_XFS_DEBUG_EXPENSIVE=y, so please don't remove this check.

Woops, true that, my cscope didn't find it somehow :( Thanks for the heads up.

Quoted 27 lines

--D

Quoted 23 lines
---
 fs/xfs/libxfs/xfs_alloc.c | 3 ---
 1 file changed, 3 deletions(-)
fs/xfs/libxfs/xfs_alloc.c +0 -3
index 3d33e17f2e5c..619e6d6570f8 100644
@@ -787,9 +787,6 @@ xfs_agfl_verify(
 	__be32		*agfl_bno = xfs_buf_to_agfl_bno(bp);
 	int		i;
 
-	if (!xfs_has_crc(mp))
-		return NULL;
-
 	if (!xfs_verify_magic(bp, agfl->agfl_magicnum))
 		return __this_address;
 	if (!uuid_equal(&agfl->agfl_uuid, &mp->m_sb.sb_meta_uuid))
Signature · 1 line
2.47.1