* [PATCH] xfs: remove xfs_bmap_sanity_check()
@ 2015-02-25 6:41 Dave Chinner
2015-02-25 12:45 ` Brian Foster
2015-02-25 12:57 ` Carlos Maiolino
0 siblings, 2 replies; 3+ messages in thread
From: Dave Chinner @ 2015-02-25 6:41 UTC (permalink / raw)
To: xfs
From: Dave Chinner <dchinner@redhat.com>
This code is redundant now that we have verifiers that sanity check
the buffers as they are read from disk.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
fs/xfs/libxfs/xfs_bmap.c | 32 --------------------------------
1 file changed, 32 deletions(-)
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index 8ae3775..b872e9c 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -244,30 +244,6 @@ xfs_bmap_forkoff_reset(
}
}
-/*
- * Debug/sanity checking code
- */
-
-STATIC int
-xfs_bmap_sanity_check(
- struct xfs_mount *mp,
- struct xfs_buf *bp,
- int level)
-{
- struct xfs_btree_block *block = XFS_BUF_TO_BLOCK(bp);
-
- if (block->bb_magic != cpu_to_be32(XFS_BMAP_CRC_MAGIC) &&
- block->bb_magic != cpu_to_be32(XFS_BMAP_MAGIC))
- return 0;
-
- if (be16_to_cpu(block->bb_level) != level ||
- be16_to_cpu(block->bb_numrecs) == 0 ||
- be16_to_cpu(block->bb_numrecs) > mp->m_bmap_dmxr[level != 0])
- return 0;
-
- return 1;
-}
-
#ifdef DEBUG
STATIC struct xfs_buf *
xfs_bmap_get_bp(
@@ -410,9 +386,6 @@ xfs_bmap_check_leaf_extents(
goto error_norelse;
}
block = XFS_BUF_TO_BLOCK(bp);
- XFS_WANT_CORRUPTED_GOTO(mp,
- xfs_bmap_sanity_check(mp, bp, level),
- error0);
if (level == 0)
break;
@@ -1312,8 +1285,6 @@ xfs_bmap_read_extents(
if (error)
return error;
block = XFS_BUF_TO_BLOCK(bp);
- XFS_WANT_CORRUPTED_GOTO(mp,
- xfs_bmap_sanity_check(mp, bp, level), error0);
if (level == 0)
break;
pp = XFS_BMBT_PTR_ADDR(mp, block, 1, mp->m_bmap_dmxr[1]);
@@ -1346,9 +1317,6 @@ xfs_bmap_read_extents(
XFS_ERRLEVEL_LOW, ip->i_mount, block);
goto error0;
}
- XFS_WANT_CORRUPTED_GOTO(mp,
- xfs_bmap_sanity_check(mp, bp, 0),
- error0);
/*
* Read-ahead the next leaf block, if any.
*/
--
2.0.0
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] xfs: remove xfs_bmap_sanity_check()
2015-02-25 6:41 [PATCH] xfs: remove xfs_bmap_sanity_check() Dave Chinner
@ 2015-02-25 12:45 ` Brian Foster
2015-02-25 12:57 ` Carlos Maiolino
1 sibling, 0 replies; 3+ messages in thread
From: Brian Foster @ 2015-02-25 12:45 UTC (permalink / raw)
To: Dave Chinner; +Cc: xfs
On Wed, Feb 25, 2015 at 05:41:10PM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
>
> This code is redundant now that we have verifiers that sanity check
> the buffers as they are read from disk.
>
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> ---
Reviewed-by: Brian Foster <bfoster@redhat.com>
> fs/xfs/libxfs/xfs_bmap.c | 32 --------------------------------
> 1 file changed, 32 deletions(-)
>
> diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
> index 8ae3775..b872e9c 100644
> --- a/fs/xfs/libxfs/xfs_bmap.c
> +++ b/fs/xfs/libxfs/xfs_bmap.c
> @@ -244,30 +244,6 @@ xfs_bmap_forkoff_reset(
> }
> }
>
> -/*
> - * Debug/sanity checking code
> - */
> -
> -STATIC int
> -xfs_bmap_sanity_check(
> - struct xfs_mount *mp,
> - struct xfs_buf *bp,
> - int level)
> -{
> - struct xfs_btree_block *block = XFS_BUF_TO_BLOCK(bp);
> -
> - if (block->bb_magic != cpu_to_be32(XFS_BMAP_CRC_MAGIC) &&
> - block->bb_magic != cpu_to_be32(XFS_BMAP_MAGIC))
> - return 0;
> -
> - if (be16_to_cpu(block->bb_level) != level ||
> - be16_to_cpu(block->bb_numrecs) == 0 ||
> - be16_to_cpu(block->bb_numrecs) > mp->m_bmap_dmxr[level != 0])
> - return 0;
> -
> - return 1;
> -}
> -
> #ifdef DEBUG
> STATIC struct xfs_buf *
> xfs_bmap_get_bp(
> @@ -410,9 +386,6 @@ xfs_bmap_check_leaf_extents(
> goto error_norelse;
> }
> block = XFS_BUF_TO_BLOCK(bp);
> - XFS_WANT_CORRUPTED_GOTO(mp,
> - xfs_bmap_sanity_check(mp, bp, level),
> - error0);
> if (level == 0)
> break;
>
> @@ -1312,8 +1285,6 @@ xfs_bmap_read_extents(
> if (error)
> return error;
> block = XFS_BUF_TO_BLOCK(bp);
> - XFS_WANT_CORRUPTED_GOTO(mp,
> - xfs_bmap_sanity_check(mp, bp, level), error0);
> if (level == 0)
> break;
> pp = XFS_BMBT_PTR_ADDR(mp, block, 1, mp->m_bmap_dmxr[1]);
> @@ -1346,9 +1317,6 @@ xfs_bmap_read_extents(
> XFS_ERRLEVEL_LOW, ip->i_mount, block);
> goto error0;
> }
> - XFS_WANT_CORRUPTED_GOTO(mp,
> - xfs_bmap_sanity_check(mp, bp, 0),
> - error0);
> /*
> * Read-ahead the next leaf block, if any.
> */
> --
> 2.0.0
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xfs: remove xfs_bmap_sanity_check()
2015-02-25 6:41 [PATCH] xfs: remove xfs_bmap_sanity_check() Dave Chinner
2015-02-25 12:45 ` Brian Foster
@ 2015-02-25 12:57 ` Carlos Maiolino
1 sibling, 0 replies; 3+ messages in thread
From: Carlos Maiolino @ 2015-02-25 12:57 UTC (permalink / raw)
To: Dave Chinner; +Cc: xfs
Looks good to me, consider adding:
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
On Wed, Feb 25, 2015 at 05:41:10PM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
>
> This code is redundant now that we have verifiers that sanity check
> the buffers as they are read from disk.
>
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> ---
> fs/xfs/libxfs/xfs_bmap.c | 32 --------------------------------
> 1 file changed, 32 deletions(-)
>
> diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
> index 8ae3775..b872e9c 100644
> --- a/fs/xfs/libxfs/xfs_bmap.c
> +++ b/fs/xfs/libxfs/xfs_bmap.c
> @@ -244,30 +244,6 @@ xfs_bmap_forkoff_reset(
> }
> }
>
> -/*
> - * Debug/sanity checking code
> - */
> -
> -STATIC int
> -xfs_bmap_sanity_check(
> - struct xfs_mount *mp,
> - struct xfs_buf *bp,
> - int level)
> -{
> - struct xfs_btree_block *block = XFS_BUF_TO_BLOCK(bp);
> -
> - if (block->bb_magic != cpu_to_be32(XFS_BMAP_CRC_MAGIC) &&
> - block->bb_magic != cpu_to_be32(XFS_BMAP_MAGIC))
> - return 0;
> -
> - if (be16_to_cpu(block->bb_level) != level ||
> - be16_to_cpu(block->bb_numrecs) == 0 ||
> - be16_to_cpu(block->bb_numrecs) > mp->m_bmap_dmxr[level != 0])
> - return 0;
> -
> - return 1;
> -}
> -
> #ifdef DEBUG
> STATIC struct xfs_buf *
> xfs_bmap_get_bp(
> @@ -410,9 +386,6 @@ xfs_bmap_check_leaf_extents(
> goto error_norelse;
> }
> block = XFS_BUF_TO_BLOCK(bp);
> - XFS_WANT_CORRUPTED_GOTO(mp,
> - xfs_bmap_sanity_check(mp, bp, level),
> - error0);
> if (level == 0)
> break;
>
> @@ -1312,8 +1285,6 @@ xfs_bmap_read_extents(
> if (error)
> return error;
> block = XFS_BUF_TO_BLOCK(bp);
> - XFS_WANT_CORRUPTED_GOTO(mp,
> - xfs_bmap_sanity_check(mp, bp, level), error0);
> if (level == 0)
> break;
> pp = XFS_BMBT_PTR_ADDR(mp, block, 1, mp->m_bmap_dmxr[1]);
> @@ -1346,9 +1317,6 @@ xfs_bmap_read_extents(
> XFS_ERRLEVEL_LOW, ip->i_mount, block);
> goto error0;
> }
> - XFS_WANT_CORRUPTED_GOTO(mp,
> - xfs_bmap_sanity_check(mp, bp, 0),
> - error0);
> /*
> * Read-ahead the next leaf block, if any.
> */
> --
> 2.0.0
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
--
Carlos
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-02-25 12:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-25 6:41 [PATCH] xfs: remove xfs_bmap_sanity_check() Dave Chinner
2015-02-25 12:45 ` Brian Foster
2015-02-25 12:57 ` Carlos Maiolino
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox