summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub/scrub.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/scrub/scrub.c')
-rw-r--r--fs/xfs/scrub/scrub.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/fs/xfs/scrub/scrub.c b/fs/xfs/scrub/scrub.c
index 5a12debea50f..5caf15522012 100644
--- a/fs/xfs/scrub/scrub.c
+++ b/fs/xfs/scrub/scrub.c
@@ -505,6 +505,30 @@ static inline void xchk_postmortem(struct xfs_scrub *sc)
}
#endif /* CONFIG_XFS_ONLINE_REPAIR */
+static inline void
+whine(struct xfs_scrub *sc, int error)
+{
+ struct xfs_scrub_metadata *sm = sc->sm;
+ const char *wut = NULL;
+
+ if (sc->flags & XREP_ALREADY_FIXED) {
+ wut = "*** REPAIR SUCCESS";
+ error = 0;
+ } else if (error == -EAGAIN)
+ wut = "??? REPAIR DEFERRED";
+ else if (error != -EOPNOTSUPP && error != -ENOENT)
+ wut = "!!! REPAIR FAILED";
+
+ if (!wut)
+ return;
+
+ xfs_info(sc->mp,
+"%s ino 0x%llx type %u agno 0x%x inum 0x%llx gen 0x%x flags 0x%x error %d",
+ wut, XFS_I(file_inode(sc->file))->i_ino, sm->sm_type,
+ sm->sm_agno, sm->sm_ino, sm->sm_gen, sm->sm_flags,
+ error);
+}
+
/* Dispatch metadata scrubbing. */
int
xfs_scrub_metadata(
@@ -606,6 +630,7 @@ retry_op:
* already tried to fix it, then attempt a repair.
*/
error = xrep_attempt(sc);
+ whine(sc, error);
if (error == -EAGAIN) {
/*
* Either the repair function succeeded or it couldn't