]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blobdiff - scrub/common.c
xfs_scrub: explicitly track corruptions, not just errors
[thirdparty/xfsprogs-dev.git] / scrub / common.c
index 8bd1984896600b036f9168a08bd7dae15a4e9b6c..26756c58019d1f6bf38ce52d7ca1aba8c350cfb3 100644 (file)
@@ -36,7 +36,7 @@ xfs_scrub_excessive_errors(
        bool                    ret;
 
        pthread_mutex_lock(&ctx->lock);
-       ret = ctx->max_errors > 0 && ctx->errors_found >= ctx->max_errors;
+       ret = ctx->max_errors > 0 && ctx->corruptions_found >= ctx->max_errors;
        pthread_mutex_unlock(&ctx->lock);
 
        return ret;
@@ -50,6 +50,10 @@ static struct {
                .string = "Error",
                .loglevel = LOG_ERR,
        },
+       [S_CORRUPT] = {
+               .string = "Corruption",
+               .loglevel = LOG_ERR,
+       },
        [S_WARN]   = {
                .string = "Warning",
                .loglevel = LOG_WARNING,
@@ -121,10 +125,10 @@ __str_out(
                fflush(stream);
 
 out_record:
-       if (error)      /* A syscall failed */
+       if (error || level == S_ERROR)      /* A syscall failed */
                ctx->runtime_errors++;
-       else if (level == S_ERROR)
-               ctx->errors_found++;
+       else if (level == S_CORRUPT)
+               ctx->corruptions_found++;
        else if (level == S_WARN)
                ctx->warnings_found++;
        else if (level == S_REPAIR)