diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2018-01-08 21:51:03 +0300 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2018-01-08 21:54:46 +0300 |
commit | bc1a09b8e334bf5fca1d6727aec538dcff957961 (patch) | |
tree | e870d817d5c3b4a97b1201c81d80e39bff66b763 /fs/xfs/libxfs/xfs_da_btree.c | |
parent | a6a781a58befcbd467ce843af4eaca3906aa1f08 (diff) | |
download | linux-bc1a09b8e334bf5fca1d6727aec538dcff957961.tar.xz |
xfs: refactor verifier callers to print address of failing check
Refactor the callers of verifiers to print the instruction address of a
failing check.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_da_btree.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_da_btree.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/fs/xfs/libxfs/xfs_da_btree.c b/fs/xfs/libxfs/xfs_da_btree.c index 60a2572ba4e3..0ae39617a6c1 100644 --- a/fs/xfs/libxfs/xfs_da_btree.c +++ b/fs/xfs/libxfs/xfs_da_btree.c @@ -184,9 +184,11 @@ xfs_da3_node_write_verify( struct xfs_mount *mp = bp->b_target->bt_mount; struct xfs_buf_log_item *bip = bp->b_fspriv; struct xfs_da3_node_hdr *hdr3 = bp->b_addr; + xfs_failaddr_t fa; - if (xfs_da3_node_verify(bp)) { - xfs_verifier_error(bp, -EFSCORRUPTED); + fa = xfs_da3_node_verify(bp); + if (fa) { + xfs_verifier_error(bp, -EFSCORRUPTED, fa); return; } @@ -210,17 +212,20 @@ xfs_da3_node_read_verify( struct xfs_buf *bp) { struct xfs_da_blkinfo *info = bp->b_addr; + xfs_failaddr_t fa; switch (be16_to_cpu(info->magic)) { case XFS_DA3_NODE_MAGIC: if (!xfs_buf_verify_cksum(bp, XFS_DA3_NODE_CRC_OFF)) { - xfs_verifier_error(bp, -EFSBADCRC); + xfs_verifier_error(bp, -EFSBADCRC, + __this_address); break; } /* fall through */ case XFS_DA_NODE_MAGIC: - if (xfs_da3_node_verify(bp)) - xfs_verifier_error(bp, -EFSCORRUPTED); + fa = xfs_da3_node_verify(bp); + if (fa) + xfs_verifier_error(bp, -EFSCORRUPTED, fa); return; case XFS_ATTR_LEAF_MAGIC: case XFS_ATTR3_LEAF_MAGIC: @@ -233,7 +238,7 @@ xfs_da3_node_read_verify( bp->b_ops->verify_read(bp); return; default: - xfs_verifier_error(bp, -EFSCORRUPTED); + xfs_verifier_error(bp, -EFSCORRUPTED, __this_address); break; } } |