From owner-freebsd-current Thu Jan 23 2:43: 3 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BDB8437B401 for ; Thu, 23 Jan 2003 02:43:01 -0800 (PST) Received: from relay1.macomnet.ru (relay1.macomnet.ru [195.128.64.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 80D2743F3F for ; Thu, 23 Jan 2003 02:43:00 -0800 (PST) (envelope-from maxim@macomnet.ru) Received: from news1.macomnet.ru (news1.macomnet.ru [195.128.64.14]) by relay1.macomnet.ru (8.11.6/8.11.6) with ESMTP id h0NAgxa9504381 for ; Thu, 23 Jan 2003 13:42:59 +0300 (MSK) Date: Thu, 23 Jan 2003 13:42:58 +0300 (MSK) From: Maxim Konovalov To: current@freebsd.org Subject: [PATCH]: newfs(8) FS_OPTSPACE vs FS_OPTTIME bug Message-ID: <20030123133044.G77851@news1.macomnet.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hello, newfs(8) incorrectly claims that FS_OPTTIME is unavailable when minfree is less than MINFREE. MINFREE is defined in ufs/ffs/fs.h: #define MINFREE 8 But relevant code in ufs/ffs/ffs_alloc.c uses hardcoded value: 288 if (fs->fs_minfree <= 5 || 289 fs->fs_cstotal.cs_nffree > 290 (off_t)fs->fs_dsize * fs->fs_minfree / (2 * 100)) 291 break; 292 log(LOG_NOTICE, "%s: optimization changed from SPACE to TIME\n", tunefs(8) metions 5% too. Any objections to a diff below? Index: newfs/newfs.c =================================================================== RCS file: /home/ncvs/src/sbin/newfs/newfs.c,v retrieving revision 1.66 diff -u -r1.66 newfs.c --- newfs/newfs.c 30 Nov 2002 18:28:26 -0000 1.66 +++ newfs/newfs.c 23 Jan 2003 10:26:45 -0000 @@ -327,9 +327,9 @@ maxcontig = MAX(1, MAXPHYS / bsize); if (density == 0) density = NFPI * fsize; - if (minfree < MINFREE && opt != FS_OPTSPACE) { + if (minfree <= 5 && opt != FS_OPTSPACE) { fprintf(stderr, "Warning: changing optimization to space "); - fprintf(stderr, "because minfree is less than %d%%\n", MINFREE); + fprintf(stderr, "because minfree is less than %d%%\n", 5); opt = FS_OPTSPACE; } if (maxbpg == 0) %%% -- Maxim Konovalov, maxim@macomnet.ru, maxim@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message