summaryrefslogtreecommitdiffstats
path: root/sbin/fsck_ffs/fsck.h
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2000-02-28 20:02:41 +0000
committermckusick <mckusick@FreeBSD.org>2000-02-28 20:02:41 +0000
commitbd9488796106798eb216c66dba38cdd79d3db0ff (patch)
tree9eb2bffc40748fa7b89208e5c7b21aeaf6155a1c /sbin/fsck_ffs/fsck.h
parentd9108a40031ebe250fc7cc8572abfdf5932c81d2 (diff)
downloadFreeBSD-src-bd9488796106798eb216c66dba38cdd79d3db0ff.zip
FreeBSD-src-bd9488796106798eb216c66dba38cdd79d3db0ff.tar.gz
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>
Diffstat (limited to 'sbin/fsck_ffs/fsck.h')
-rw-r--r--sbin/fsck_ffs/fsck.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/fsck_ffs/fsck.h b/sbin/fsck_ffs/fsck.h
index f7ac12c..9d59c8f 100644
--- a/sbin/fsck_ffs/fsck.h
+++ b/sbin/fsck_ffs/fsck.h
@@ -182,7 +182,7 @@ struct inoinfo {
u_int i_numblks; /* size of block array in bytes */
ufs_daddr_t i_blks[1]; /* actually longer */
} **inphead, **inpsort;
-long numdirs, listmax, inplast;
+long numdirs, dirhash, listmax, inplast;
long countdirs; /* number of directories we actually found */
char *cdevname; /* name of device being checked */
OpenPOWER on IntegriCloud