option even overrides the
.B -y
option given on the command-line (just for the specific problem, of course).
+.TP
+.I not_a_fix
+This boolean option, it set to true, marks the problem as
+one where if the user gives permission to make the requested change,
+it does not mean that the file system had a problem which has since
+been fixed. This is used for requests to optimize the file system's
+data structure, such as pruning an extent tree.
@TDB_MAN_COMMENT@.SH THE [scratch_files] STANZA
@TDB_MAN_COMMENT@The following relations are defined in the
@TDB_MAN_COMMENT@.I [scratch_files]
if (!fix_problem(ctx, PR_0_CLEAR_V2_JOURNAL, &pctx))
return;
+ ctx->flags |= E2F_FLAG_PROBLEMS_FIXED;
memset(((char *) journal->j_superblock) + V1_SB_SIZE, 0,
ctx->fs->blocksize-V1_SB_SIZE);
mark_buffer_dirty(journal->j_sb_buffer);
/* Inode extent tree could be shorter */
{ PR_1E_CAN_COLLAPSE_EXTENT_TREE,
N_("@i %i @x tree (at level %b) could be shorter. "),
- PROMPT_FIX, PR_NO_OK | PR_PREEN_NO | PR_PREEN_OK },
+ PROMPT_FIX, PR_NO_OK | PR_PREEN_NO | PR_PREEN_OK | PR_NOT_A_FIX },
/* Inode extent tree could be narrower */
{ PR_1E_CAN_NARROW_EXTENT_TREE,
N_("@i %i @x tree (at level %b) could be narrower. "),
- PROMPT_FIX, PR_NO_OK | PR_PREEN_NO | PR_PREEN_OK },
+ PROMPT_FIX, PR_NO_OK | PR_PREEN_NO | PR_PREEN_OK | PR_NOT_A_FIX },
/* Pass 2 errors */
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");
+ reconfigure_bool(ctx, ptr, key, PR_NOT_A_FIX, "not_a_fix");
profile_get_integer(ctx->profile, "options",
"max_count_problems", 0, 0,
&ptr->max_count);
if (ptr->flags & PR_AFTER_CODE)
answer = fix_problem(ctx, ptr->second_code, pctx);
- if (answer && (ptr->prompt != PROMPT_NONE))
+ if (answer && (ptr->prompt != PROMPT_NONE) &&
+ !(ptr->flags & PR_NOT_A_FIX))
ctx->flags |= E2F_FLAG_PROBLEMS_FIXED;
return answer;
#define PR_CONFIG 0x080000 /* This problem has been customized
from the config file */
#define PR_FORCE_NO 0x100000 /* Force the answer to be no */
+#define PR_NOT_A_FIX 0x200000 /* Yes doesn't mean a problem was fixed */
fix_problem(ctx, PR_6_IO_FLUSH, &pctx);
if (was_changed) {
- exit_value |= FSCK_NONDESTRUCT;
- if (!(ctx->options & E2F_OPT_PREEN))
- log_out(ctx, _("\n%s: ***** FILE SYSTEM WAS "
- "MODIFIED *****\n"),
+ int fs_fixed = (ctx->flags & E2F_FLAG_PROBLEMS_FIXED);
+
+ if (fs_fixed)
+ exit_value |= FSCK_NONDESTRUCT;
+ if (!(ctx->options & E2F_OPT_PREEN)) {
+#if 0 /* Do this later; it breaks too many tests' golden outputs */
+ log_out(ctx, fs_fixed ?
+ _("\n%s: ***** FILE SYSTEM ERRORS "
+ "CORRECTED *****\n") :
+ _("%s: File system was modified.\n"),
ctx->device_name);
+#else
+ log_out(ctx,
+ _("\n%s: ***** FILE SYSTEM WAS MODIFIED *****\n"),
+ ctx->device_name);
+#endif
+ }
if (ctx->mount_flags & EXT2_MF_ISROOT) {
log_out(ctx, _("%s: ***** REBOOT SYSTEM *****\n"),
ctx->device_name);
test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
test_filesys: 12/128 files (0.0% non-contiguous), 19/512 blocks
-Exit status is 1
+Exit status is 0
test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
test_filesys: 12/128 files (8.3% non-contiguous), 26/512 blocks
-Exit status is 1
+Exit status is 0
test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
test_filesys: 12/128 files (8.3% non-contiguous), 570/2048 blocks
-Exit status is 1
+Exit status is 0
test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
test_filesys: 13/128 files (15.4% non-contiguous), 574/2048 blocks
-Exit status is 1
+Exit status is 0
0 sockets
------------
343 files
-Exit status is 1
+Exit status is 0
test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
test_filesys: 11/2048 files (9.1% non-contiguous), 1330/8192 blocks
-Exit status is 1
+Exit status is 0
test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
test_filesys: 53/2048 files (1.9% non-contiguous), 1409/8192 blocks
-Exit status is 1
+Exit status is 0
test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
test_filesys: 12/2048 files (0.0% non-contiguous), 1303/8192 blocks
-Exit status is 1
+Exit status is 0
test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
test_filesys: 12/16 files (0.0% non-contiguous), 21/100 blocks
-Exit status is 1
+Exit status is 0
test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
test_filesys: 105/2048 files (2.9% non-contiguous), 336/512 blocks
-Exit status is 1
+Exit status is 0
test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
test_filesys: 12/2048 files (0.0% non-contiguous), 1294/2048 blocks
-Exit status is 1
+Exit status is 0