From 33493b18209e482d5ad58206ea870b4132d217eb Mon Sep 17 00:00:00 2001 From: Kirk McKusick Date: Mon, 2 Dec 2002 19:31:53 +0000 Subject: [PATCH] Correctly calculate the initial number of fragments in a filesystem so that fsck does not complain with `SUMMARY BLK COUNT(S) WRONG IN SUPERBLK' the first time it is run on a new filesystem. Reported by: Poul-Henning Kamp Sponsored by: DARPA & NAI Labs. --- sbin/newfs/mkfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c index 625efb5ab76f..4b78f9bc14cf 100644 --- a/sbin/newfs/mkfs.c +++ b/sbin/newfs/mkfs.c @@ -403,8 +403,8 @@ mkfs(struct partition *pp, char *fsys) howmany(csfrags, sblock.fs_frag); sblock.fs_cstotal.cs_nffree = fragnum(&sblock, sblock.fs_size) + - (numfrags(&sblock, csfrags) > 0 ? - sblock.fs_frag - numfrags(&sblock, csfrags) : 0); + (fragnum(&sblock, csfrags) > 0 ? + sblock.fs_frag - fragnum(&sblock, csfrags) : 0); sblock.fs_cstotal.cs_nifree = sblock.fs_ncg * sblock.fs_ipg - ROOTINO; sblock.fs_cstotal.cs_ndir = 0; sblock.fs_dsize -= csfrags;