git: bc444e2ec6e6 - main - Fix fsck_ffs Pass 1b error exit "bad inode number 2 to nextinode".

Kirk McKusick mckusick at FreeBSD.org
Wed Mar 24 23:49:34 UTC 2021


The branch main has been updated by mckusick:

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

commit bc444e2ec6e6cc9d96d35ab7ce3c02c0da952fad
Author:     Kirk McKusick <mckusick at FreeBSD.org>
AuthorDate: 2021-03-24 23:50:24 +0000
Commit:     Kirk McKusick <mckusick at FreeBSD.org>
CommitDate: 2021-03-24 23:53:28 +0000

    Fix fsck_ffs Pass 1b error exit "bad inode number 2 to nextinode".
    
    Pass 1b of fsck_ffs runs only when Pass 1 has found duplicate blocks.
    When starting up, Pass 1b failed to properly skip over the two unused
    inodes at the beginning of the filesystem resulting in the above error
    message when it tried to read the filesystem root inode.
    
    Reported by:  Chuck Silvers
    Tested by:    Chuck Silvers
    MFC after:    3 days
    Sponsored by: Netflix
---
 sbin/fsck_ffs/pass1b.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sbin/fsck_ffs/pass1b.c b/sbin/fsck_ffs/pass1b.c
index 8c09ef36acad..b44e0107c982 100644
--- a/sbin/fsck_ffs/pass1b.c
+++ b/sbin/fsck_ffs/pass1b.c
@@ -78,8 +78,10 @@ pass1b(void)
 			continue;
 		setinodebuf(c, inosused);
 		for (i = 0; i < inosused; i++, inumber++) {
-			if (inumber < UFS_ROOTINO)
+			if (inumber < UFS_ROOTINO) {
+				(void)getnextinode(inumber, 0);
 				continue;
+			}
 			dp = getnextinode(inumber, 0);
 			idesc.id_number = inumber;
 			idesc.id_type = inoinfo(inumber)->ino_idtype;


More information about the dev-commits-src-all mailing list