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;
.string = "Error",
.loglevel = LOG_ERR,
},
+ [S_CORRUPT] = {
+ .string = "Corruption",
+ .loglevel = LOG_ERR,
+ },
[S_WARN] = {
.string = "Warning",
.loglevel = LOG_WARNING,
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)
enum error_level {
S_ERROR = 0,
+ S_CORRUPT,
S_WARN,
S_INFO,
S_REPAIR,
__str_out(ctx, str, S_ERROR, errno, __FILE__, __LINE__, NULL)
#define str_liberror(ctx, error, str) \
__str_out(ctx, str, S_ERROR, error, __FILE__, __LINE__, NULL)
+#define str_corrupt(ctx, str, ...) \
+ __str_out(ctx, str, S_CORRUPT, 0, __FILE__, __LINE__, __VA_ARGS__)
#define str_error(ctx, str, ...) \
__str_out(ctx, str, S_ERROR, 0, __FILE__, __LINE__, __VA_ARGS__)
#define str_warn(ctx, str, ...) \
workqueue_destroy(&wq);
pthread_mutex_lock(&ctx->lock);
- if (moveon && ctx->errors_found == 0 && want_fstrim) {
+ if (moveon && ctx->corruptions_found == 0 && want_fstrim) {
fstrim(ctx);
progress_add(1);
}
bool moveon = true;
bool ret;
- if (ctx->errors_found) {
+ if (ctx->corruptions_found) {
str_info(ctx, ctx->mntpoint,
_("Filesystem has errors, skipping connectivity checks."));
return true;
}
if (bitmap_test(bmp, bmap->bm_physical, bmap->bm_length))
- str_error(ctx, descr,
+ str_corrupt(ctx, descr,
_("media error in extended attribute data."));
return true;
snprintf(buf, DESCR_BUFSZ, _("disk offset %"PRIu64),
(uint64_t)map->fmr_physical + err_off);
type = xfs_decode_special_owner(map->fmr_owner);
- str_error(ctx, buf, _("media error in %s."), type);
+ str_corrupt(ctx, buf, _("media error in %s."), type);
}
/* Report extent maps */
map->fmr_owner, 0, " %s",
attr ? _("extended attribute") :
_("file data"));
- str_error(ctx, buf, _("media error in extent map"));
+ str_corrupt(ctx, buf, _("media error in extent map"));
}
/*
*/
if (is_corrupt(meta) || xref_disagrees(meta)) {
if (ctx->mode < SCRUB_MODE_REPAIR) {
- str_error(ctx, buf,
+ str_corrupt(ctx, buf,
_("Repairs are required."));
return CHECK_DONE;
}
/* fall through */
case EINVAL:
/* Kernel doesn't know how to repair this? */
- str_error(ctx, buf,
+ str_corrupt(ctx, buf,
_("Don't know how to fix; offline repair required."));
return CHECK_DONE;
case EROFS:
*/
if (!(repair_flags & XRM_COMPLAIN_IF_UNFIXED))
return CHECK_RETRY;
- str_error(ctx, buf,
+ str_corrupt(ctx, buf,
_("Repair unsuccessful; offline repair required."));
} else {
/* Clean operation, no corruption detected. */
{
unsigned long long total_errors;
- total_errors = ctx->errors_found + ctx->runtime_errors;
+ total_errors = ctx->corruptions_found + ctx->runtime_errors;
if (total_errors == 0 && ctx->warnings_found == 0) {
log_info(ctx, _("No problems found."));
return;
}
- if (total_errors > 0) {
- fprintf(stderr, _("%s: errors found: %llu\n"), ctx->mntpoint,
- total_errors);
- log_err(ctx, _("errors found: %llu"), total_errors);
+ if (ctx->corruptions_found > 0) {
+ fprintf(stderr, _("%s: corruptions found: %llu\n"),
+ ctx->mntpoint, ctx->corruptions_found);
+ log_err(ctx, _("corruptions found: %llu"),
+ ctx->corruptions_found);
+ }
+
+ if (ctx->runtime_errors > 0) {
+ fprintf(stderr, _("%s: operational errors found: %llu\n"),
+ ctx->mntpoint, ctx->runtime_errors);
+ log_err(ctx, _("operational errors found: %llu"),
+ ctx->runtime_errors);
}
if (ctx->warnings_found > 0) {
report_modifications(&ctx);
report_outcome(&ctx);
- if (ctx.errors_found) {
+ if (ctx.corruptions_found) {
if (ctx.error_action == ERRORS_SHUTDOWN)
xfs_shutdown_fs(&ctx);
ret |= SCRUB_RET_CORRUPT;
struct xfs_action_list *action_lists;
unsigned long long max_errors;
unsigned long long runtime_errors;
- unsigned long long errors_found;
+ unsigned long long corruptions_found;
unsigned long long warnings_found;
unsigned long long inodes_checked;
unsigned long long bytes_checked;