diff options
author | 2004-06-22 01:58:59 +0000 | |
---|---|---|
committer | 2004-06-22 01:58:59 +0000 | |
commit | 99d5636199b7c1a56fa9d64bf4e45a9ec0b482cc (patch) | |
tree | 2fc4b1b5444b1585c20bbf2615329fb332bf08d4 | |
parent | Make the `filename' parameter to HASHFile() and HASHFileChunk() const (diff) | |
download | wireguard-openbsd-99d5636199b7c1a56fa9d64bf4e45a9ec0b482cc.tar.xz wireguard-openbsd-99d5636199b7c1a56fa9d64bf4e45a9ec0b482cc.zip |
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@
-rw-r--r-- | sbin/newfs/mkfs.c | 7 |
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++) { |