From owner-freebsd-fs@FreeBSD.ORG Wed Aug 29 04:09:27 2007 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40FBF16A417 for ; Wed, 29 Aug 2007 04:09:27 +0000 (UTC) (envelope-from lorenl@north-winds.org) Received: from hosea.tallye.com (unknown [IPv6:2002:d863:c74e::104]) by mx1.freebsd.org (Postfix) with ESMTP id E18FB13C458 for ; Wed, 29 Aug 2007 04:09:26 +0000 (UTC) (envelope-from lorenl@north-winds.org) Received: from [IPv6:2002:d863:c74e:0:213:d4ff:fe1a:7c2a] ([IPv6:2002:d863:c74e:0:213:d4ff:fe1a:7c2a]) (authenticated bits=0) by hosea.tallye.com (8.14.1/8.13.6) with ESMTP id l7T493aB016062 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 28 Aug 2007 21:09:06 -0700 DomainKey-Signature: a=rsa-sha1; s=main; d=north-winds.org; c=nofws; q=dns; h=message-id:date:from:user-agent:mime-version:to:subject: x-enigmail-version:content-type:x-greylist:received-spf:x-virus-scanned:x-virus-status; b=qAp0QwE3AHWnsaq2aC1XKNNNP0zze/UNsQzVbtLYfdmZP0qbNH/ma+T6OrsZZPgpJ tqiE7scUVPv2KjMzb9vIXeADAuIwsV9A+JnwEvNu2fnFmta4auP/QIvtsjzBXs8 Message-ID: <46D4F12D.3080107@north-winds.org> Date: Tue, 28 Aug 2007 21:08:13 -0700 From: "Loren M. Lang" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.6) Gecko/20070728 Thunderbird/2.0.0.6 Mnenhy/0.7.5.0 MIME-Version: 1.0 To: freebsd-fs X-Enigmail-Version: 0.95.3 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig3468D36E3974A45E7EA54A01" X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (hosea.tallye.com [IPv6:2002:d863:c74e::2]); Tue, 28 Aug 2007 21:09:06 -0700 (PDT) Received-SPF: pass (hosea.tallye.com: is authenticated by a trusted mechanism) X-Virus-Scanned: ClamAV version 0.90.3, clamav-milter version 0.90.3 on hosea.tallye.com X-Virus-Status: Clean Subject: Bug in Newfs setting max-extend-size X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2007 04:09:27 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig3468D36E3974A45E7EA54A01 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I was reading through the newfs source code for FreeBSD 6.1-RELEASE and noticed some oddities between the man page for newfs and it's source related to max-extent-size (-d). Newfs claims that the default is 16 times the filesystem blocksize. ("... It is presently limited to its default value which is 16 times the file system blocksize.") However, in the source code, if maxbsize is not specified, it is assigned bsize, not 16*bsize. newfs.c: if (maxbsize =3D=3D 0) maxbsize =3D bsize; Also, in mkfs.c, mkfs() does some sanity checks on maxbsize, but in the second if statement on line 211, it checks sblock.fs_maxbsize, not maxbsize, but as far as I can tell, sblock.fs_maxbsize is not yet initialized. mkfs.c: if (maxbsize < bsize || !POWEROF2(maxbsize)) { sblock.fs_maxbsize =3D sblock.fs_bsize; printf("Extent size set to %d\n", sblock.fs_maxbsize); } else if (sblock.fs_maxbsize > FS_MAXCONTIG * sblock.fs_bsize) {= sblock.fs_maxbsize =3D FS_MAXCONTIG * sblock.fs_bsize; printf("Extent size reduced to %d\n", sblock.fs_maxbsize)= ; } else { sblock.fs_maxbsize =3D maxbsize; } Unless I am misunderstanding something, the else if() should read: } else if (maxbsize > FS_MAXCONTIG * sblock.fs_bsize) { This appears to be the same in FreeBSD-CURRENT as well. --=20 Loren M. Lang lorenl@north-winds.org http://www.north-winds.org/ Public Key: ftp://ftp.north-winds.org/pub/lorenl_pubkey.asc Fingerprint: CEE1 AAE2 F66C 59B5 34CA C415 6D35 E847 0118 A3D2 --------------enig3468D36E3974A45E7EA54A01 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFG1PE2SHsHRHUO+igRAkbPAKDqe+DiUGz7r0AoHZNUPYYaLonywgCgnmBj M84udkGCe3H1yQWDMuw9mzY= =xLYZ -----END PGP SIGNATURE----- --------------enig3468D36E3974A45E7EA54A01--