@@ -88,7 +88,7 @@ try_inode_repair(
return 0;
ret = action_list_process(ictx->ctx, fd, alist,
- ALP_REPAIR_ONLY | ALP_NOPROGRESS);
+ XRM_REPAIR_ONLY | XRM_NOPROGRESS);
if (ret)
return ret;
@@ -54,7 +54,7 @@ repair_ag(
} while (unfixed > 0);
/* Try once more, but this time complain if we can't fix things. */
- flags |= ALP_COMPLAIN_IF_UNFIXED;
+ flags |= XRM_FINAL_WARNING;
ret = action_list_process(ctx, -1, alist, flags);
if (ret)
*aborted = true;
@@ -422,7 +422,7 @@ fs_scan_worker(
}
ret = action_list_process(ctx, ctx->mnt.fd, &item->alist,
- ALP_COMPLAIN_IF_UNFIXED | ALP_NOPROGRESS);
+ XRM_FINAL_WARNING | XRM_NOPROGRESS);
if (ret) {
str_liberror(ctx, ret, _("repairing fs scan metadata"));
*item->abortedp = true;
@@ -122,7 +122,7 @@ phase7_func(
if (error)
return error;
error = action_list_process(ctx, -1, &alist,
- ALP_COMPLAIN_IF_UNFIXED | ALP_NOPROGRESS);
+ XRM_FINAL_WARNING | XRM_NOPROGRESS);
if (error)
return error;
@@ -274,7 +274,7 @@ action_list_process(
fix = xfs_repair_metadata(ctx, xfdp, aitem, repair_flags);
switch (fix) {
case CHECK_DONE:
- if (!(repair_flags & ALP_NOPROGRESS))
+ if (!(repair_flags & XRM_NOPROGRESS))
progress_add(1);
alist->nr--;
list_del(&aitem->list);
@@ -316,7 +316,7 @@ action_list_process_or_defer(
int ret;
ret = action_list_process(ctx, -1, alist,
- ALP_REPAIR_ONLY | ALP_NOPROGRESS);
+ XRM_REPAIR_ONLY | XRM_NOPROGRESS);
if (ret)
return ret;
@@ -32,10 +32,18 @@ void action_list_find_mustfix(struct action_list *actions,
unsigned long long *broken_primaries,
unsigned long long *broken_secondaries);
-/* Passed through to xfs_repair_metadata() */
-#define ALP_REPAIR_ONLY (XRM_REPAIR_ONLY)
-#define ALP_COMPLAIN_IF_UNFIXED (XRM_COMPLAIN_IF_UNFIXED)
-#define ALP_NOPROGRESS (1U << 31)
+/*
+ * Only ask the kernel to repair this object if the kernel directly told us it
+ * was corrupt. Objects that are only flagged as having cross-referencing
+ * errors or flagged as eligible for optimization are left for later.
+ */
+#define XRM_REPAIR_ONLY (1U << 0)
+
+/* This is the last repair attempt; complain if still broken even after fix. */
+#define XRM_FINAL_WARNING (1U << 1)
+
+/* Don't call progress_add after repairing an item. */
+#define XRM_NOPROGRESS (1U << 2)
int action_list_process(struct scrub_ctx *ctx, int fd,
struct action_list *alist, unsigned int repair_flags);
@@ -743,7 +743,7 @@ _("Filesystem is shut down, aborting."));
* could fix this, it's at least worth trying the scan
* again to see if another repair fixed it.
*/
- if (!(repair_flags & XRM_COMPLAIN_IF_UNFIXED))
+ if (!(repair_flags & XRM_FINAL_WARNING))
return CHECK_RETRY;
fallthrough;
case EINVAL:
@@ -773,13 +773,13 @@ _("Read-only filesystem; cannot make changes."));
* to requeue the repair for later and don't say a
* thing. Otherwise, print error and bail out.
*/
- if (!(repair_flags & XRM_COMPLAIN_IF_UNFIXED))
+ if (!(repair_flags & XRM_FINAL_WARNING))
return CHECK_RETRY;
str_liberror(ctx, error, descr_render(&dsc));
return CHECK_DONE;
}
- if (repair_flags & XRM_COMPLAIN_IF_UNFIXED)
+ if (repair_flags & XRM_FINAL_WARNING)
scrub_warn_incomplete_scrub(ctx, &dsc, &meta);
if (needs_repair(&meta)) {
/*
@@ -787,7 +787,7 @@ _("Read-only filesystem; cannot make changes."));
* just requeue this and try again later. Otherwise we
* log the error loudly and don't try again.
*/
- if (!(repair_flags & XRM_COMPLAIN_IF_UNFIXED))
+ if (!(repair_flags & XRM_FINAL_WARNING))
return CHECK_RETRY;
str_corrupt(ctx, descr_render(&dsc),
_("Repair unsuccessful; offline repair required."));
@@ -799,7 +799,7 @@ _("Repair unsuccessful; offline repair required."));
* caller to run xfs_repair; otherwise, we'll keep trying to
* reverify the cross-referencing as repairs progress.
*/
- if (repair_flags & XRM_COMPLAIN_IF_UNFIXED) {
+ if (repair_flags & XRM_FINAL_WARNING) {
str_info(ctx, descr_render(&dsc),
_("Seems correct but cross-referencing failed; offline repair recommended."));
} else {
@@ -54,16 +54,6 @@ struct action_item {
__u32 agno;
};
-/*
- * Only ask the kernel to repair this object if the kernel directly told us it
- * was corrupt. Objects that are only flagged as having cross-referencing
- * errors or flagged as eligible for optimization are left for later.
- */
-#define XRM_REPAIR_ONLY (1U << 0)
-
-/* Complain if still broken even after fix. */
-#define XRM_COMPLAIN_IF_UNFIXED (1U << 1)
-
enum check_outcome xfs_repair_metadata(struct scrub_ctx *ctx,
struct xfs_fd *xfdp, struct action_item *aitem,
unsigned int repair_flags);