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.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/fs/xfs/scrub/scrub.c b/fs/xfs/scrub/scrub.c
index 0c5f8b0995b6..a12612dd5df2 100644
--- a/fs/xfs/scrub/scrub.c
+++ b/fs/xfs/scrub/scrub.c
@@ -505,6 +505,36 @@ static inline void xchk_postmortem(struct xfs_scrub *sc)
}
#endif /* CONFIG_XFS_ONLINE_REPAIR */
+static inline void
+repair_outcomes(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";
+ 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);
+ return;
+ } else {
+ return;
+ }
+
+ xfs_info_ratelimited(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(
@@ -603,6 +633,7 @@ retry_op:
* already tried to fix it, then attempt a repair.
*/
error = xrep_attempt(sc);
+ repair_outcomes(sc, error);
if (error == -EAGAIN) {
/*
* Either the repair function succeeded or it couldn't