public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libxfs: Remove pointless crc flag check from xfs_agfl_verify
@ 2025-01-16 16:32 cem
  2025-01-16 16:53 ` Darrick J. Wong
  0 siblings, 1 reply; 3+ messages in thread
From: cem @ 2025-01-16 16:32 UTC (permalink / raw)
  To: linux-xfs; +Cc: cem

From: Carlos Maiolino <cem@kernel.org>

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.

Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
---
 fs/xfs/libxfs/xfs_alloc.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
index 3d33e17f2e5c..619e6d6570f8 100644
--- a/fs/xfs/libxfs/xfs_alloc.c
+++ b/fs/xfs/libxfs/xfs_alloc.c
@@ -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))
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] libxfs: Remove pointless crc flag check from xfs_agfl_verify
  2025-01-16 16:32 [PATCH] libxfs: Remove pointless crc flag check from xfs_agfl_verify cem
@ 2025-01-16 16:53 ` Darrick J. Wong
  2025-01-16 17:28   ` Carlos Maiolino
  0 siblings, 1 reply; 3+ messages in thread
From: Darrick J. Wong @ 2025-01-16 16:53 UTC (permalink / raw)
  To: cem; +Cc: linux-xfs

On Thu, Jan 16, 2025 at 05:32:56PM +0100, cem@kernel.org wrote:
> From: Carlos Maiolino <cem@kernel.org>
> 
> 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

> Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
> ---
>  fs/xfs/libxfs/xfs_alloc.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
> index 3d33e17f2e5c..619e6d6570f8 100644
> --- a/fs/xfs/libxfs/xfs_alloc.c
> +++ b/fs/xfs/libxfs/xfs_alloc.c
> @@ -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))
> -- 
> 2.47.1
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] libxfs: Remove pointless crc flag check from xfs_agfl_verify
  2025-01-16 16:53 ` Darrick J. Wong
@ 2025-01-16 17:28   ` Carlos Maiolino
  0 siblings, 0 replies; 3+ messages in thread
From: Carlos Maiolino @ 2025-01-16 17:28 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs

On Thu, Jan 16, 2025 at 08:53:52AM -0800, Darrick J. Wong wrote:
> On Thu, Jan 16, 2025 at 05:32:56PM +0100, cem@kernel.org wrote:
> > From: Carlos Maiolino <cem@kernel.org>
> > 
> > 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.

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


> 
> --D
> 
> > Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
> > ---
> >  fs/xfs/libxfs/xfs_alloc.c | 3 ---
> >  1 file changed, 3 deletions(-)
> > 
> > diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
> > index 3d33e17f2e5c..619e6d6570f8 100644
> > --- a/fs/xfs/libxfs/xfs_alloc.c
> > +++ b/fs/xfs/libxfs/xfs_alloc.c
> > @@ -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))
> > -- 
> > 2.47.1
> > 
> > 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-01-16 17:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-16 16:32 [PATCH] libxfs: Remove pointless crc flag check from xfs_agfl_verify cem
2025-01-16 16:53 ` Darrick J. Wong
2025-01-16 17:28   ` Carlos Maiolino

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox