return false;
pthread_mutex_lock(&ctx->lock);
- errors_seen = ctx->corruptions_found;
+ errors_seen = ctx->corruptions_found + ctx->unfixable_errors;
pthread_mutex_unlock(&ctx->lock);
return errors_seen >= ctx->max_errors;
.string = "Corruption",
.loglevel = LOG_ERR,
},
+ [S_UNFIXABLE] = {
+ .string = "Unfixable Error",
+ .loglevel = LOG_ERR,
+ },
[S_WARN] = {
.string = "Warning",
.loglevel = LOG_WARNING,
ctx->runtime_errors++;
else if (level == S_CORRUPT)
ctx->corruptions_found++;
+ else if (level == S_UNFIXABLE)
+ ctx->unfixable_errors++;
else if (level == S_WARN)
ctx->warnings_found++;
else if (level == S_REPAIR)
enum error_level {
S_ERROR = 0,
S_CORRUPT,
+ S_UNFIXABLE,
S_WARN,
S_INFO,
S_REPAIR,
__str_out(ctx, str, S_REPAIR, 0, __FILE__, __LINE__, __VA_ARGS__)
#define record_preen(ctx, str, ...) \
__str_out(ctx, str, S_PREEN, 0, __FILE__, __LINE__, __VA_ARGS__)
+#define str_unfixable_error(ctx, str, ...) \
+ __str_out(ctx, str, S_UNFIXABLE, 0, __FILE__, __LINE__, __VA_ARGS__)
#define dbg_printf(fmt, ...) \
do {if (debug > 1) {printf(fmt, __VA_ARGS__);}} while (0)
workqueue_destroy(&wq);
pthread_mutex_lock(&ctx->lock);
- if (moveon && ctx->corruptions_found == 0 && want_fstrim) {
+ if (moveon &&
+ ctx->corruptions_found == 0 &&
+ ctx->unfixable_errors == 0 &&
+ want_fstrim) {
fstrim(ctx);
progress_add(1);
}
bool moveon = true;
bool ret;
- if (ctx->corruptions_found) {
+ if (ctx->corruptions_found || ctx->unfixable_errors) {
str_info(ctx, ctx->mntpoint,
_("Filesystem has errors, skipping connectivity checks."));
return true;
bad_length = min(start + length,
br->bmap->bm_physical + br->bmap->bm_length) - start;
- str_error(br->ctx, br->descr,
+ str_unfixable_error(br->ctx, br->descr,
_("media error at data offset %llu length %llu."),
br->bmap->bm_offset + bad_offset, bad_length);
return 0;
report_outcome(
struct scrub_ctx *ctx)
{
- unsigned long long total_errors;
+ unsigned long long actionable_errors;
- total_errors = ctx->corruptions_found + ctx->runtime_errors;
+ actionable_errors = ctx->corruptions_found + ctx->runtime_errors;
- if (total_errors == 0 && ctx->warnings_found == 0) {
+ if (actionable_errors == 0 &&
+ ctx->unfixable_errors == 0 &&
+ ctx->warnings_found == 0) {
log_info(ctx, _("No problems found."));
return;
}
+ if (ctx->unfixable_errors) {
+ fprintf(stderr, _("%s: unfixable errors found: %llu\n"),
+ ctx->mntpoint, ctx->unfixable_errors);
+ log_err(ctx, _("unfixable errors found: %llu"),
+ ctx->unfixable_errors);
+ }
+
if (ctx->corruptions_found > 0) {
fprintf(stderr, _("%s: corruptions found: %llu\n"),
ctx->mntpoint, ctx->corruptions_found);
* setting up the scrub and we actually saw corruptions. Warnings
* are not corruptions.
*/
- if (ctx->scrub_setup_succeeded && total_errors > 0) {
+ if (ctx->scrub_setup_succeeded && actionable_errors > 0) {
char *msg;
if (ctx->mode == SCRUB_MODE_DRY_RUN)
unsigned long long max_errors;
unsigned long long runtime_errors;
unsigned long long corruptions_found;
+ unsigned long long unfixable_errors;
unsigned long long warnings_found;
unsigned long long inodes_checked;
unsigned long long bytes_checked;