From owner-freebsd-current@FreeBSD.ORG Fri Feb 19 20:19:00 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56750106566C for ; Fri, 19 Feb 2010 20:19:00 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello089077043238.chello.pl [89.77.43.238]) by mx1.freebsd.org (Postfix) with ESMTP id 99E378FC0C for ; Fri, 19 Feb 2010 20:18:59 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 212C245E93; Fri, 19 Feb 2010 21:18:58 +0100 (CET) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 9726E45D8D; Fri, 19 Feb 2010 21:18:52 +0100 (CET) Date: Fri, 19 Feb 2010 21:18:50 +0100 From: Pawel Jakub Dawidek To: Alexander Zagrebin Message-ID: <20100219201850.GB1617@garage.freebsd.pl> References: <8630BB25CB8C41E8BF036431AAC9B0A9@vosz.local> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="JYK4vJDZwFMowpUq" Content-Disposition: inline In-Reply-To: <8630BB25CB8C41E8BF036431AAC9B0A9@vosz.local> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: freebsd-current@freebsd.org Subject: Re: ZFS: statfs and recordsize problem X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 20:19:00 -0000 --JYK4vJDZwFMowpUq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 18, 2010 at 03:39:28PM +0300, Alexander Zagrebin wrote: > I have noticed, that statfs called for ZFS file systems, > returns the value of FS's recordsize property in both f_bsize and > f_iosize. >=20 > It's a problem for some software. > For example, squid uses block size of cache's file system to calculate > the space occupied by file. > So by default it considers that any small file uses 128KB of a cache > (when default value of recordsize is used), though really this file > may use 512B only. > This miscalculation leads to unreasonable cleaning of a cache. >=20 > IMHO the behavior of statfs have to be changed, as ZFS uses variable > (up to recordsize) block sizes. > It must return 512 as f_bsize and recordsize as f_iosize. > One of possible solutions is the attached patch. > Could somebody look it? I committed (slightly modified version of) your patch to HEAD. Thanks! --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --JYK4vJDZwFMowpUq Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkt+8ikACgkQForvXbEpPzTxbACfSO4TxiwyrRyLBVjfioiU13M8 iPkAnj5XuT2PNvlmkqLmnidwtgeihT7x =cK/Z -----END PGP SIGNATURE----- --JYK4vJDZwFMowpUq--