From owner-freebsd-bugs Sat Jul 6 20:40:11 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id UAA21818 for bugs-outgoing; Sat, 6 Jul 1996 20:40:11 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id UAA21771; Sat, 6 Jul 1996 20:40:05 -0700 (PDT) Resent-Date: Sat, 6 Jul 1996 20:40:05 -0700 (PDT) Resent-Message-Id: <199607070340.UAA21771@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, marcs@worldgate.com 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 ; 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 ; 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 X-Send-Pr-Version: 3.2 Subject: docs/1374: incorrect default for the -i option in the newfs(8) man page Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >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: freebsd-bugs >State: open >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Sat Jul 6 20:40:03 PDT 1996 >Last-Modified: >Originator: marcs >Organization: >Release: FreeBSD 2.1-STABLE i386 >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): , 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. >Audit-Trail: >Unformatted: