From owner-cvs-all Mon Feb 28 12: 2:46 2000 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 1B23637B793; Mon, 28 Feb 2000 12:02:43 -0800 (PST) (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id MAA50539; Mon, 28 Feb 2000 12:02:42 -0800 (PST) (envelope-from mckusick@FreeBSD.org) Message-Id: <200002282002.MAA50539@freefall.freebsd.org> From: Kirk McKusick Date: Mon, 28 Feb 2000 12:02:42 -0800 (PST) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sbin/fsck fsck.h setup.c inode.c Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk mckusick 2000/02/28 12:02:42 PST Modified files: sbin/fsck fsck.h setup.c inode.c Log: Yesterday I had to fix a badly broken disk, and found that fsck kept dying: DIR I=64512 CONNECTED. PARENT WAS I=4032 fsck: cannot find inode 995904 fsdb found the inodes with no problem: fsdb (inum: 64512)> inode 995904 current inode: directory I=995904 MODE=40777 SIZE=512 MTIME=Feb 14 15:27:07 2000 [0 nsec] CTIME=Feb 14 15:27:07 2000 [0 nsec] ATIME=Feb 24 10:31:58 2000 [0 nsec] OWNER=nobody GRP=nobody LINKCNT=4 FLAGS=0 BLKCNT=2 GEN=38a41386 Direct blocks: 8094568 0 0 0 0 0 0 0 0 0 0 0 Indirect blocks: 0 0 0 The problem turns out to be a program logic error in fsck. It stores directory inodes internally in hash lists, using the number of directories to form the hash key: inpp = &inphead[inumber % numdirs]; Elsewhere, however, it increments numdirs when it finds unattached directories. I've made the following fix, which solved the problem in the case in hand. Submitted by: Greg Lehey Reviewed by: Matthew Dillon Approved by: Kirk McKusick Revision Changes Path 1.12 +2 -2 src/sbin/fsck/fsck.h 1.17 +2 -1 src/sbin/fsck/setup.c 1.20 +3 -3 src/sbin/fsck/inode.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message