Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Apr 2021 01:39:46 GMT
From:      Kirk McKusick <mckusick@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 689724cb23c2 - main - Clean up fsck_ffs error message output.
Message-ID:  <202104270139.13R1dkK6004165@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by mckusick:

URL: https://cgit.FreeBSD.org/src/commit/?id=689724cb23c2acf58091c80f27de4823d7cd87ca

commit 689724cb23c2acf58091c80f27de4823d7cd87ca
Author:     Kirk McKusick <mckusick@FreeBSD.org>
AuthorDate: 2021-04-27 01:42:48 +0000
Commit:     Kirk McKusick <mckusick@FreeBSD.org>
CommitDate: 2021-04-27 01:43:51 +0000

    Clean up fsck_ffs error message output.
    
    When fsck_ffs is creating a lost+found directory it must allocate
    an inode and a filesystem block. If it encounters a cylinder group
    with a bad check hash, it complains twice: once for the inode and
    again for the filesystem block.
    
    This change suppresses the second complaint.
    
    Reported by:  Chuck Silvers
    Tested by:    Chuck Silvers
    MFC after:    1 week
    Sponsored by: Netflix
---
 sbin/fsck_ffs/fsutil.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/sbin/fsck_ffs/fsutil.c b/sbin/fsck_ffs/fsutil.c
index 276d543dedc6..b13ba4c54bde 100644
--- a/sbin/fsck_ffs/fsutil.c
+++ b/sbin/fsck_ffs/fsutil.c
@@ -948,6 +948,7 @@ check_cgmagic(int cg, struct bufarea *cgbp, int request_rebuild)
 {
 	struct cg *cgp = cgbp->b_un.b_cg;
 	uint32_t cghash, calchash;
+	static int prevfailcg = -1;
 
 	/*
 	 * Extended cylinder group checks.
@@ -973,9 +974,14 @@ check_cgmagic(int cg, struct bufarea *cgbp, int request_rebuild)
 	      cgp->cg_initediblk <= sblock.fs_ipg))) {
 		return (1);
 	}
+	if (prevfailcg == cg)
+		return (0);
+	prevfailcg = cg;
 	pfatal("CYLINDER GROUP %d: INTEGRITY CHECK FAILED", cg);
-	if (!request_rebuild)
+	if (!request_rebuild) {
+		printf("\n");
 		return (0);
+	}
 	if (!reply("REBUILD CYLINDER GROUP")) {
 		printf("YOU WILL NEED TO RERUN FSCK.\n");
 		rerun = 1;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104270139.13R1dkK6004165>