]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: xfs_buf_corruption_error should take __this_address
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 1 May 2020 21:37:08 +0000 (17:37 -0400)
committerEric Sandeen <sandeen@redhat.com>
Fri, 1 May 2020 21:37:08 +0000 (17:37 -0400)
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 <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/libxfs_priv.h
libxfs/rdwr.c
libxfs/util.c

index 120ff3dc6d181ac75f795a9d70abea8544b583dd..23a5689076d0eedb4f65187b9c9cd8a0205e2f72 100644 (file)
@@ -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 */
index a236a84b8705338b16c0fe092ceb9867af1b3681..641593870c0790922ec59169638786488bf3f59d 100644 (file)
@@ -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);
 }
index 0c76c8cd87e957bddc73d14fa806ee05a9519a64..975bfa267d4edb4d0c9b10eb5bdb341fca6e34a8 100644 (file)
@@ -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);
 }
 
 /*