diff --git a/e2fsck/problem.c b/e2fsck/problem.c index b951eb75..c66c6be8 100644 --- a/e2fsck/problem.c +++ b/e2fsck/problem.c @@ -1824,10 +1824,13 @@ int fix_problem(e2fsck_t ctx, problem_t code, struct problem_context *pctx) reconfigure_bool(ctx, ptr, key, PR_NO_NOMSG, "no_nomsg"); reconfigure_bool(ctx, ptr, key, PR_PREEN_NOHDR, "preen_noheader"); reconfigure_bool(ctx, ptr, key, PR_FORCE_NO, "force_no"); + profile_get_integer(ctx->profile, "problems", key, "max_count", + ptr->max_count, &ptr->max_count); ptr->flags |= PR_CONFIG; } def_yn = 1; + ptr->count++; if ((ptr->flags & PR_NO_DEFAULT) || ((ptr->flags & PR_PREEN_NO) && (ctx->options & E2F_OPT_PREEN)) || (ctx->options & E2F_OPT_NO)) @@ -1856,6 +1859,16 @@ int fix_problem(e2fsck_t ctx, problem_t code, struct problem_context *pctx) if ((ptr->flags & PR_NO_NOMSG) && ((ctx->options & E2F_OPT_NO) || (ptr->flags & PR_FORCE_NO))) suppress++; + if (ptr->max_count && (ptr->count > ptr->max_count)) { + if (ctx->options & (E2F_OPT_NO | E2F_OPT_YES)) + suppress++; + if ((ctx->options & E2F_OPT_PREEN) && + (ptr->flags & PR_PREEN_OK)) + suppress++; + if ((ptr->flags & PR_LATCH_MASK) && + (ldesc->flags & (PRL_YES | PRL_NO))) + suppress++; + } if (!suppress) { message = ptr->e2p_description; if ((ctx->options & E2F_OPT_PREEN) && @@ -1927,6 +1940,13 @@ profile_get_boolean(profile_t profile, const char *name, const char *subname, return 0; } +errcode_t +profile_get_integer(profile_t profile, const char *name, const char *subname, + const char *subsubname, int def_val, int *ret_int) +{ + return 0; +} + void print_e2fsck_message(e2fsck_t ctx, const char *msg, struct problem_context *pctx, int first, int recurse) diff --git a/e2fsck/problemP.h b/e2fsck/problemP.h index a2ed35e5..7944cd6c 100644 --- a/e2fsck/problemP.h +++ b/e2fsck/problemP.h @@ -15,6 +15,8 @@ struct e2fsck_problem { char prompt; int flags; problem_t second_code; + int count; + int max_count; }; struct latch_descr {