diff options
author | mckusick <mckusick@FreeBSD.org> | 2002-12-02 19:31:53 +0000 |
---|---|---|
committer | mckusick <mckusick@FreeBSD.org> | 2002-12-02 19:31:53 +0000 |
commit | 09074e808047049fdcb245eb25886bc976452efa (patch) | |
tree | c990b4324e1075def2b924518726539b3c2fa617 /sbin/newfs | |
parent | 87d881b0faa9c2ac68c80ee73ab7905a5be6cc9f (diff) | |
download | FreeBSD-src-09074e808047049fdcb245eb25886bc976452efa.zip FreeBSD-src-09074e808047049fdcb245eb25886bc976452efa.tar.gz |
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 <phk@freebsd.org>
Sponsored by: DARPA & NAI Labs.
Diffstat (limited to 'sbin/newfs')
-rw-r--r-- | sbin/newfs/mkfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; |