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 01/18] xfs: add a repair revalidation function pointer
Date: Sun, 04 Aug 2019 17:34:49 -0700	[thread overview]
Message-ID: <156496528958.804304.6442207831934063382.stgit@magnolia> (raw)
In-Reply-To: <156496528310.804304.8105015456378794397.stgit@magnolia>

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

Allow repair functions to set a separate function pointer to validate
the metadata that they've rebuilt.  This prevents us from exiting from a
repair function that rebuilds both A and B without checking that both A
and B can pass a scrub test.  We'll need this for the free space and
inode btree repair strategies.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/scrub/scrub.c |    5 ++++-
 fs/xfs/scrub/scrub.h |    8 ++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)


diff --git a/fs/xfs/scrub/scrub.c b/fs/xfs/scrub/scrub.c
index 15c8c5f3f688..0f0b64d7164b 100644
--- a/fs/xfs/scrub/scrub.c
+++ b/fs/xfs/scrub/scrub.c
@@ -495,7 +495,10 @@ xfs_scrub_metadata(
 		goto out_teardown;
 
 	/* Scrub for errors. */
-	error = sc.ops->scrub(&sc);
+	if ((sc.flags & XREP_ALREADY_FIXED) && sc.ops->repair_eval != NULL)
+		error = sc.ops->repair_eval(&sc);
+	else
+		error = sc.ops->scrub(&sc);
 	if (!(sc.flags & XCHK_TRY_HARDER) && error == -EDEADLOCK) {
 		/*
 		 * Scrubbers return -EDEADLOCK to mean 'try harder'.
diff --git a/fs/xfs/scrub/scrub.h b/fs/xfs/scrub/scrub.h
index ad1ceb44a628..94a30637a127 100644
--- a/fs/xfs/scrub/scrub.h
+++ b/fs/xfs/scrub/scrub.h
@@ -27,6 +27,14 @@ struct xchk_meta_ops {
 	/* Repair or optimize the metadata. */
 	int		(*repair)(struct xfs_scrub *);
 
+	/*
+	 * Re-scrub the metadata we repaired, in case there's extra work that
+	 * we need to do to check our repair work.  If this is NULL, we'll use
+	 * the ->scrub function pointer, assuming that the regular scrub is
+	 * sufficient.
+	 */
+	int		(*repair_eval)(struct xfs_scrub *sc);
+
 	/* Decide if we even have this piece of metadata. */
 	bool		(*has)(struct xfs_sb *);
 

  reply	other threads:[~2019-08-05  0:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-05  0:34 [PATCH v19 00/18] xfs: online repair support Darrick J. Wong
2019-08-05  0:34 ` Darrick J. Wong [this message]
2019-08-05  0:34 ` [PATCH 02/18] xfs: always rescan allegedly healthy per-ag metadata after repair Darrick J. Wong
2019-08-05  0:35 ` [PATCH 03/18] xfs: create a big array data structure Darrick J. Wong
2019-08-05  0:35 ` [PATCH 04/18] xfs: repair free space btrees Darrick J. Wong
2019-08-05  0:35 ` [PATCH 05/18] xfs: repair inode btrees Darrick J. Wong
2019-08-05  0:35 ` [PATCH 06/18] xfs: repair refcount btrees Darrick J. Wong
2019-08-05  0:35 ` [PATCH 07/18] xfs: repair inode records Darrick J. Wong
2019-08-05  0:35 ` [PATCH 08/18] xfs: zap broken inode forks Darrick J. Wong
2019-08-05  0:35 ` [PATCH 09/18] xfs: repair inode block maps Darrick J. Wong
2019-08-05  0:35 ` [PATCH 10/18] xfs: repair damaged symlinks Darrick J. Wong
2019-08-05  0:35 ` [PATCH 11/18] xfs: create a blob array data structure Darrick J. Wong
2019-08-05  0:36 ` [PATCH 12/18] xfs: convert xfs_itruncate_extents_flags to use __xfs_bunmapi Darrick J. Wong
2019-08-05  0:36 ` [PATCH 13/18] xfs: remove unnecessary inode-transaction roll Darrick J. Wong
2019-08-05  0:36 ` [PATCH 14/18] xfs: create a new inode fork block unmap helper Darrick J. Wong
2019-08-05  0:36 ` [PATCH 15/18] xfs: repair extended attributes Darrick J. Wong
2019-08-05  0:36 ` [PATCH 16/18] xfs: scrub should set preen if attr leaf has holes Darrick J. Wong
2019-08-05  0:36 ` [PATCH 17/18] xfs: repair quotas Darrick J. Wong
2019-08-05  0:36 ` [PATCH 18/18] xfs: convert big array and blob array to use memfd backend Darrick J. Wong
2019-08-05  7:20 ` [PATCH v19 00/18] xfs: online repair support 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=156496528958.804304.6442207831934063382.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.