Don't advise the user to run xfs_repair on a filesystem that triggers
warnings but no errors; there's no corruption for it to fix.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
* purely setup errors).
*/
log_info(ctx, _("Invoking online scrub."), ctx);
- ctx->need_repair = true;
+ ctx->scrub_setup_succeeded = true;
return true;
}
total_errors, ctx->warnings_found);
}
- if (ctx->need_repair)
+ /*
+ * Don't advise the user to run repair unless we were successful in
+ * setting up the scrub and we actually saw corruptions. Warnings
+ * are not corruptions.
+ */
+ if (ctx->scrub_setup_succeeded && total_errors > 0)
fprintf(stderr, _("%s: Unmount and run xfs_repair.\n"),
ctx->mntpoint);
}
unsigned long long naming_warnings;
unsigned long long repairs;
unsigned long long preens;
- bool need_repair;
+ bool scrub_setup_succeeded;
bool preen_triggers[XFS_SCRUB_TYPE_NR];
};