From 09074e808047049fdcb245eb25886bc976452efa Mon Sep 17 00:00:00 2001 From: mckusick Date: Mon, 2 Dec 2002 19:31:53 +0000 Subject: 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(-) (limited to 'sbin') diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c index 625efb5..4b78f9b 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; -- cgit v1.1