diff --git a/fs/xfs/scrub/stats.c b/fs/xfs/scrub/stats.c index da0c05ffe5cd..3339cae4b39d 100644 --- a/fs/xfs/scrub/stats.c +++ b/fs/xfs/scrub/stats.c @@ -29,6 +29,7 @@ struct xchk_scrub_stats { uint32_t incomplete; uint32_t warning; uint32_t retries; + uint32_t runtime_errors; /* repair stats */ uint32_t repair_invocations; @@ -110,7 +111,7 @@ xchk_stats_format( spin_unlock(&css->css_lock); ret = scnprintf(buf, remaining, - "%s %u %u %u %u %u %u %u %u %u %llu %u %u %llu\n", + "%s %u %u %u %u %u %u %u %u %u %llu %u %u %llu %u\n", name_map[i], (unsigned int)fss.invocations, (unsigned int)fss.clean, @@ -124,7 +125,8 @@ xchk_stats_format( (unsigned long long)fss.checktime_us, (unsigned int)fss.repair_invocations, (unsigned int)fss.repair_success, - (unsigned long long)fss.repairtime_us); + (unsigned long long)fss.repairtime_us, + (unsigned int)fss.runtime_errors); if (ret <= 0) break; @@ -207,13 +209,17 @@ xchk_stats_merge_one( } /* caller applies this same transformation after we return */ - if (error == -EFSCORRUPTED || error == -EFSBADCRC) + if (error == -EFSCORRUPTED || error == -EFSBADCRC) { sm_flags |= XFS_SCRUB_OFLAG_CORRUPT; + error = 0; + } css = &cs->cs_stats[sm->sm_type]; spin_lock(&css->css_lock); css->invocations++; - if (!(sm_flags & XFS_SCRUB_OFLAG_UNCLEAN)) + if (error) + css->runtime_errors++; + else if (!(sm_flags & XFS_SCRUB_OFLAG_UNCLEAN)) css->clean++; if (sm_flags & XFS_SCRUB_OFLAG_CORRUPT) css->corrupt++;