summaryrefslogtreecommitdiff
path: root/sbin/newfs/mkfs.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2004-06-22 01:59:00 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2004-06-22 01:59:00 +0000
commit8b32c325ee92af9acc675d6382c7a492cecbb813 (patch)
tree2718f47b388fbdb6c99e3f28f902258c2af28693 /sbin/newfs/mkfs.c
parentc76ce989a22a1e133c2c2d95f9c3bc9f9fdbf5bf (diff)
acg.cg_nextfreeoff is already relative to &acg so don't subtract
&acg.cg_firstfield. Fixes a bogus "panic: cylinder group too big" I see sometimes when using mmap malloc. OK tholo@
Diffstat (limited to 'sbin/newfs/mkfs.c')
-rw-r--r--sbin/newfs/mkfs.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c
index 9a98cc611e4..48c96a22139 100644
--- a/sbin/newfs/mkfs.c
+++ b/sbin/newfs/mkfs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mkfs.c,v 1.39 2004/05/13 22:36:39 mickey Exp $ */
+/* $OpenBSD: mkfs.c,v 1.40 2004/06/22 01:58:59 millert Exp $ */
/* $NetBSD: mkfs.c,v 1.25 1995/06/18 21:35:38 cgd Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)mkfs.c 8.3 (Berkeley) 2/3/94";
#else
-static char rcsid[] = "$OpenBSD: mkfs.c,v 1.39 2004/05/13 22:36:39 mickey Exp $";
+static char rcsid[] = "$OpenBSD: mkfs.c,v 1.40 2004/06/22 01:58:59 millert Exp $";
#endif
#endif /* not lint */
@@ -750,9 +750,8 @@ initcg(int cylno, time_t utime)
acg.cg_nextfreeoff = acg.cg_clusteroff + howmany
(sblock.fs_cpg * sblock.fs_spc / NSPB(&sblock), NBBY);
}
- if (acg.cg_nextfreeoff - (long)(&acg.cg_firstfield) > sblock.fs_cgsize) {
+ if (acg.cg_nextfreeoff > sblock.fs_cgsize)
errx(37, "panic: cylinder group too big");
- }
acg.cg_cs.cs_nifree += sblock.fs_ipg;
if (cylno == 0)
for (i = 0; i < ROOTINO; i++) {