summaryrefslogtreecommitdiffstats
path: root/sbin/newfs
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2007-04-18 14:13:31 +0000
committerotto <otto@openbsd.org>2007-04-18 14:13:31 +0000
commitdd0c58bc4892435e2b51f0c5ebd5b53e357cc0da (patch)
treea8e248d0efcc68ccd5204b54a17f5e26cf5ad692 /sbin/newfs
parentDo not exit when the TIOCSDTR ioctl() fails, but output a warning. (diff)
downloadwireguard-openbsd-dd0c58bc4892435e2b51f0c5ebd5b53e357cc0da.tar.xz
wireguard-openbsd-dd0c58bc4892435e2b51f0c5ebd5b53e357cc0da.zip
don't let fpg and spc get out of sync. solves a few cases where newfs
produces a bad cg when -c is used. ok pedro@ millert@
Diffstat (limited to 'sbin/newfs')
-rw-r--r--sbin/newfs/mkfs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c
index 32acd5daada..87bcf177729 100644
--- a/sbin/newfs/mkfs.c
+++ b/sbin/newfs/mkfs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mkfs.c,v 1.56 2007/04/17 14:24:14 millert Exp $ */
+/* $OpenBSD: mkfs.c,v 1.57 2007/04/18 14:13:31 otto Exp $ */
/* $NetBSD: mkfs.c,v 1.25 1995/06/18 21:35:38 cgd Exp $ */
/*
@@ -371,8 +371,9 @@ mkfs(struct partition *pp, char *fsys, int fi, int fo, mode_t mfsmode,
* grow any larger, the number of cylinder groups drops below
* mincylgrps, or we reach the requested size.
*/
- for (; sblock.fs_fpg < maxblkspercg; sblock.fs_fpg += sblock.fs_frag) {
- sblock.fs_spc = sblock.fs_fpg * sblock.fs_nspf;
+ for (; sblock.fs_fpg < maxblkspercg;
+ sblock.fs_fpg += sblock.fs_frag,
+ sblock.fs_spc = sblock.fs_fpg * sblock.fs_nspf) {
sblock.fs_ipg = roundup(howmany(sblock.fs_fpg, fragsperinode),
INOPB(&sblock));