@@ -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'.
@@ -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 *);