All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 2/7] xfs: xfs_buf_corruption_error should take __this_address
Date: Tue, 10 Mar 2020 17:47:25 -0700	[thread overview]
Message-ID: <158388764539.939165.6782481626684056069.stgit@magnolia> (raw)
In-Reply-To: <158388763282.939165.6485358230553665775.stgit@magnolia>

From: Darrick J. Wong <darrick.wong@oracle.com>

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.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/xfs_buf.c   |    2 +-
 fs/xfs/xfs_error.c |    5 +++--
 fs/xfs/xfs_error.h |    2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)


diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 9d26e37f78f5..28304dc751d8 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -1593,7 +1593,7 @@ __xfs_buf_mark_corrupt(
 	ASSERT(bp->b_log_item == NULL ||
 	       !(bp->b_log_item->bli_flags & XFS_BLI_DIRTY));
 
-	xfs_buf_corruption_error(bp);
+	xfs_buf_corruption_error(bp, fa);
 	xfs_buf_stale(bp);
 }
 
diff --git a/fs/xfs/xfs_error.c b/fs/xfs/xfs_error.c
index 57068d4ffba2..a21e9cc6516a 100644
--- a/fs/xfs/xfs_error.c
+++ b/fs/xfs/xfs_error.c
@@ -350,13 +350,14 @@ xfs_corruption_error(
  */
 void
 xfs_buf_corruption_error(
-	struct xfs_buf		*bp)
+	struct xfs_buf		*bp,
+	xfs_failaddr_t		fa)
 {
 	struct xfs_mount	*mp = bp->b_mount;
 
 	xfs_alert_tag(mp, XFS_PTAG_VERIFIER_ERROR,
 		  "Metadata corruption detected at %pS, %s block 0x%llx",
-		  __return_address, bp->b_ops->name, bp->b_bn);
+		  fa, bp->b_ops->name, bp->b_bn);
 
 	xfs_alert(mp, "Unmount and run xfs_repair");
 
diff --git a/fs/xfs/xfs_error.h b/fs/xfs/xfs_error.h
index 31a5d321ba9a..1717b7508356 100644
--- a/fs/xfs/xfs_error.h
+++ b/fs/xfs/xfs_error.h
@@ -15,7 +15,7 @@ extern void xfs_corruption_error(const char *tag, int level,
 			struct xfs_mount *mp, const void *buf, size_t bufsize,
 			const char *filename, int linenum,
 			xfs_failaddr_t failaddr);
-void xfs_buf_corruption_error(struct xfs_buf *bp);
+void xfs_buf_corruption_error(struct xfs_buf *bp, xfs_failaddr_t fa);
 extern void xfs_buf_verifier_error(struct xfs_buf *bp, int error,
 			const char *name, const void *buf, size_t bufsz,
 			xfs_failaddr_t failaddr);


  parent reply	other threads:[~2020-03-11  0:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11  0:47 [PATCH v2 0/7] xfs: fix errors in various verifiers Darrick J. Wong
2020-03-11  0:47 ` [PATCH 1/7] xfs: add a function to deal with corrupt buffers post-verifiers Darrick J. Wong
2020-03-11  5:35   ` Dave Chinner
2020-03-11 16:42     ` Darrick J. Wong
2020-03-11 18:25   ` [PATCH v2 " Darrick J. Wong
2020-03-12  4:37     ` Dave Chinner
2020-03-12  4:55       ` Darrick J. Wong
2020-03-11  0:47 ` Darrick J. Wong [this message]
2020-03-11  5:36   ` [PATCH 2/7] xfs: xfs_buf_corruption_error should take __this_address Dave Chinner
2020-03-11  0:47 ` [PATCH 3/7] xfs: fix buffer corruption reporting when xfs_dir3_free_header_check fails Darrick J. Wong
2020-03-11  5:39   ` Dave Chinner
2020-03-11  0:47 ` [PATCH 4/7] xfs: don't ever return a stale pointer from __xfs_dir3_free_read Darrick J. Wong
2020-03-11  5:47   ` Dave Chinner
2020-03-11  0:47 ` [PATCH 5/7] xfs: check owner of dir3 free blocks Darrick J. Wong
2020-03-11  5:47   ` Dave Chinner
2020-03-11  0:47 ` [PATCH 6/7] xfs: check owner of dir3 data blocks Darrick J. Wong
2020-03-11  5:51   ` Dave Chinner
2020-03-11  0:47 ` [PATCH 7/7] xfs: check owner of dir3 blocks Darrick J. Wong
2020-03-11  5:52   ` Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=158388764539.939165.6782481626684056069.stgit@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.