summaryrefslogtreecommitdiff
path: root/sbin/fsck_ffs/pass1.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/fsck_ffs/pass1.c')
-rw-r--r--sbin/fsck_ffs/pass1.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sbin/fsck_ffs/pass1.c b/sbin/fsck_ffs/pass1.c
index 010054ca545..ef6d8f163cf 100644
--- a/sbin/fsck_ffs/pass1.c
+++ b/sbin/fsck_ffs/pass1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pass1.c,v 1.30 2008/11/09 15:54:54 chl Exp $ */
+/* $OpenBSD: pass1.c,v 1.31 2009/05/29 07:57:43 otto Exp $ */
/* $NetBSD: pass1.c,v 1.16 1996/09/27 22:45:15 christos Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)pass1.c 8.1 (Berkeley) 6/5/93";
#else
-static const char rcsid[] = "$OpenBSD: pass1.c,v 1.30 2008/11/09 15:54:54 chl Exp $";
+static const char rcsid[] = "$OpenBSD: pass1.c,v 1.31 2009/05/29 07:57:43 otto Exp $";
#endif
#endif /* not lint */
@@ -102,9 +102,11 @@ pass1(void)
inumber = c * sblock.fs_ipg;
setinodebuf(inumber);
getblk(&cgblk, cgtod(&sblock, c), sblock.fs_cgsize);
- if (sblock.fs_magic == FS_UFS2_MAGIC)
+ if (sblock.fs_magic == FS_UFS2_MAGIC) {
inosused = cgrp.cg_initediblk;
- else
+ if (inosused > sblock.fs_ipg)
+ inosused = sblock.fs_ipg;
+ } else
inosused = sblock.fs_ipg;
cginosused[c] = inosused;
for (i = 0; i < inosused; i++, inumber++) {