From c094263a249be5fd9b28c81fdc6657db766451c5 Mon Sep 17 00:00:00 2001 From: Kirk McKusick Date: Tue, 24 Dec 2019 23:03:12 +0000 Subject: [PATCH] When running fsck_ffs manually, do not ask: USE JOURNAL? [yn] when the journal timestamp does not match the filesystem mount time as we are just going to print an error and fall through to a full fsck. Instead, just run a full fsck. Requested by: Bjoern A. Zeeb (bz) MFC after: 7 days --- sbin/fsck_ffs/main.c | 12 +++++------- sbin/fsck_ffs/suj.c | 2 ++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sbin/fsck_ffs/main.c b/sbin/fsck_ffs/main.c index 8a028ec97a49..6284ce1e5130 100644 --- a/sbin/fsck_ffs/main.c +++ b/sbin/fsck_ffs/main.c @@ -423,13 +423,11 @@ checkfilesys(char *filesys) */ if ((sblock.fs_flags & FS_SUJ) == FS_SUJ) { if ((sblock.fs_flags & FS_NEEDSFSCK) != FS_NEEDSFSCK && skipclean) { - if (preen || reply("USE JOURNAL")) { - if (suj_check(filesys) == 0) { - printf("\n***** FILE SYSTEM MARKED CLEAN *****\n"); - if (chkdoreload(mntp) == 0) - exit(0); - exit(4); - } + if (suj_check(filesys) == 0) { + printf("\n***** FILE SYSTEM MARKED CLEAN *****\n"); + if (chkdoreload(mntp) == 0) + exit(0); + exit(4); } printf("** Skipping journal, falling through to full fsck\n\n"); } diff --git a/sbin/fsck_ffs/suj.c b/sbin/fsck_ffs/suj.c index 0391f327c0f1..be742e1b6773 100644 --- a/sbin/fsck_ffs/suj.c +++ b/sbin/fsck_ffs/suj.c @@ -2720,6 +2720,8 @@ suj_check(const char *filesys) printf("** SU+J Recovering %s\n", filesys); if (suj_verifyino(jip) != 0) return (-1); + if (!preen && !reply("USE JOURNAL")) + return (-1); /* * Build a list of journal blocks in jblocks before parsing the * available journal blocks in with suj_read().