Kirk McKusick e50342e665 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 <grog@lemis.com>
Reviewed by:	Matthew Dillon <dillon@apollo.backplane.com>
Approved by:	Kirk McKusick <mckusick@mckusick.com>
2000-02-28 20:02:41 +00:00
..
1999-08-28 00:22:10 +00:00
1999-08-28 00:22:10 +00:00
1999-10-05 21:19:41 +00:00
1999-08-28 00:22:10 +00:00
1999-08-28 00:22:10 +00:00
1999-08-28 00:22:10 +00:00
1999-08-28 00:22:10 +00:00
1999-08-28 00:22:10 +00:00
2000-02-24 21:01:54 +00:00
1999-08-28 00:22:10 +00:00
2000-02-11 11:25:23 +00:00
2000-02-11 11:25:23 +00:00
2000-02-28 18:38:19 +00:00
1999-12-15 19:48:02 +00:00
1999-12-15 19:48:02 +00:00
2000-02-09 21:01:35 +00:00
1999-12-15 19:48:02 +00:00
1999-12-04 01:29:43 +00:00
2000-02-22 01:40:43 +00:00
1999-11-15 03:13:23 +00:00
1999-12-09 19:10:13 +00:00
2000-02-22 01:40:43 +00:00
2000-02-26 13:13:16 +00:00
1999-08-28 00:22:10 +00:00
1999-08-28 00:22:10 +00:00
2000-02-24 21:01:54 +00:00
1999-08-28 00:22:10 +00:00
2000-02-24 21:01:54 +00:00
1999-08-28 00:22:10 +00:00
1999-08-28 00:22:10 +00:00
1999-08-28 00:22:10 +00:00
1999-08-28 00:22:10 +00:00
2000-01-29 13:54:44 +00:00