From marcs@worldgate.com  Sat Jul  6 20:36:13 1996
Received: from valis.worldgate.com (root@valis.worldgate.com [198.161.84.2])
          by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id UAA21590
          for <FreeBSD-gnats-submit@freebsd.org>; Sat, 6 Jul 1996 20:36:12 -0700 (PDT)
Received: from gras-varg.worldgate.com (root@gras-varg.worldgate.com [198.161.84.12]) by valis.worldgate.com (8.6.12/8.6.12) with ESMTP id VAA15387 for <FreeBSD-gnats-submit@freebsd.org>; Sat, 6 Jul 1996 21:36:10 -0600
Received: (from marcs@localhost) by gras-varg.worldgate.com (8.7.5/8.6.12) id VAA03344; Sat, 6 Jul 1996 21:36:09 -0600 (MDT)
Message-Id: <199607070336.VAA03344@gras-varg.worldgate.com>
Date: Sat, 6 Jul 1996 21:36:09 -0600 (MDT)
From: marcs@worldgate.com
Reply-To: marcs@worldgate.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: incorrect default for the -i option in the newfs(8) man page
X-Send-Pr-Version: 3.2

>Number:         1374
>Category:       docs
>Synopsis:       the default listed in the newfs -i man page does not agree with that in the source
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    mpp
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jul  6 20:40:03 PDT 1996
>Closed-Date:    Sat Dec 14 12:54:10 PST 1996
>Last-Modified:  Sat Dec 14 12:54:43 PST 1996
>Originator:     marcs
>Release:        FreeBSD 2.1-STABLE i386
>Organization:
>Environment:

Tested using 2.1.0-STABLE from late June/96 on a system using the 
below IDE drive.  The source that is directly relevant is the same in
release and current.

wdc1: unit 1 (wd3): <Maxtor 71260 AT>, 32-bit, multi-block-16
wd3: 1204MB (2467584 sectors), 2448 cyls, 16 heads, 63 S/T, 512 B/S


>Description:

The newfs man page says:

     -i number of bytes per inode
                 This specifies the density of inodes in the file system.  The
                 default is to create an inode for each 2048 bytes of data
                 space.  If fewer inodes are desired, a larger number should
                 be used; to create more inodes a smaller number should be
                 given.

However, sbin/newfs/newfs.c says:

-------------------
/*
 * Each file system has a number of inodes statically allocated.
 * We allocate one inode slot per NFPI fragments, expecting this
 * to be far more than we will ever need.
 */
#define NFPI            4
[...]
                case 'i':
                        if ((density = atoi(optarg)) <= 0)
                                fatal("%s: bad bytes per inode\n", optarg);
                        break;
[...]
        if (density == 0)
                density = NFPI * fsize;

[...]
        if (fsize == 0) {
                fsize = pp->p_fsize;
                if (fsize <= 0)
                        fsize = MAX(DFL_FRAGSIZE, lp->d_secsize);


---------------
When p_fsize is 1024, this works out to giving one inode for every
4096 bytes of drive space; a reasonable default, but not what the man
page says.


>How-To-Repeat:

A 'newfs /dev/wd3s1e' results in a drive with:
Filesystem   1K-blocks     Used    Avail Capacity iused   ifree %iused  Mounted on
/dev/wd3s1e    1164863   324946   746728    30%   20120  264038     7% /mnt

Which is one inode for every 4096 bytes of drive space, not every 2048
as the man page says.

>Fix:
	
Change 2048 to 4096 in the description for the default of the -i
option in the man page, assuming there are a minimal number of
situations where fsize could end up being something other than 1024.

>Release-Note:
>Audit-Trail:

From: Bruce Evans <bde@zeta.org.au>
To: FreeBSD-gnats-submit@freebsd.org, marcs@worldgate.com
Cc:  Subject: Re: docs/1374: incorrect default for the -i option in the newfs(8) man page
Date: Sun, 7 Jul 1996 22:02:14 +1000

 >>Fix:
 >	
 >Change 2048 to 4096 in the description for the default of the -i
 >option in the man page, assuming there are a minimal number of
 >situations where fsize could end up being something other than 1024.
 
 Don't assume.  Say that the default is 4 times the fragment size.
 
 I changed the default to 2048 bytes in my version of newfs, but I
 now think that 4 fragments is better - 2048 is usually too small,
 and doesn't scale properly (for fragments larger than 4096, it would
 give more inodes than possible files).
 
 Bruce
Responsible-Changed-From-To: freebsd-bugs->mpp 
Responsible-Changed-By: mpp 
Responsible-Changed-When: Mon Jul 8 16:40:28 PDT 1996 
Responsible-Changed-Why:  
Doc update - there are also a few other things 
in this man page that need updating that are on my list. 
State-Changed-From-To: open->closed 
State-Changed-By: mpp 
State-Changed-When: Sat Dec 14 12:54:10 PST 1996 
State-Changed-Why:  
Fixed in rev 1.8 of newfs.8. 
>Unformatted:
