From 9f09216e8afc075e5f20e6cb9a2f8946fa1ef461 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Fri, 1 May 2020 17:37:08 -0400 Subject: [PATCH] xfs: xfs_buf_corruption_error should take __this_address Add a xfs_failaddr_t parameter to this function so that callers can potentially pass in (and therefore report) the exact point in the code where we decided that a metadata buffer was corrupt. This enables us to wire it up to checking functions that have to run outside of verifiers. Source kernel commit: e83cf875d67a6cb9ddfaa8b45d2fa93d12b5c66f Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Eric Sandeen --- libxfs/libxfs_priv.h | 2 +- libxfs/rdwr.c | 2 +- libxfs/util.c | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h index 120ff3dc6..23a568907 100644 --- a/libxfs/libxfs_priv.h +++ b/libxfs/libxfs_priv.h @@ -531,7 +531,7 @@ void xfs_inode_verifier_error(struct xfs_inode *ip, int error, #define xfs_buf_verifier_error(bp,e,n,bu,bus,fa) \ xfs_verifier_error(bp, e, fa) void -xfs_buf_corruption_error(struct xfs_buf *bp); +xfs_buf_corruption_error(struct xfs_buf *bp, xfs_failaddr_t fa); /* XXX: this is clearly a bug - a shared header needs to export this */ /* xfs_rtalloc.c */ diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c index a236a84b8..641593870 100644 --- a/libxfs/rdwr.c +++ b/libxfs/rdwr.c @@ -1637,6 +1637,6 @@ __xfs_buf_mark_corrupt( { ASSERT(bp->b_flags & XBF_DONE); - xfs_buf_corruption_error(bp); + xfs_buf_corruption_error(bp, fa); xfs_buf_stale(bp); } diff --git a/libxfs/util.c b/libxfs/util.c index 0c76c8cd8..975bfa267 100644 --- a/libxfs/util.c +++ b/libxfs/util.c @@ -643,10 +643,11 @@ xfs_inode_verifier_error( */ void xfs_buf_corruption_error( - struct xfs_buf *bp) + struct xfs_buf *bp, + xfs_failaddr_t fa) { xfs_alert(NULL, "Metadata corruption detected at %p, %s block 0x%llx", - __return_address, bp->b_ops->name, bp->b_bn); + fa, bp->b_ops->name, bp->b_bn); } /* -- 2.50.1