Date: Thu, 23 Jan 2003 13:42:58 +0300 (MSK) From: Maxim Konovalov <maxim@macomnet.ru> To: current@freebsd.org Subject: [PATCH]: newfs(8) FS_OPTSPACE vs FS_OPTTIME bug Message-ID: <20030123133044.G77851@news1.macomnet.ru>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030123133044.G77851>
