From owner-freebsd-current@FreeBSD.ORG Thu Feb 18 14:48:39 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 A3D8C1065670 for ; Thu, 18 Feb 2010 14:48:39 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 793178FC0C for ; Thu, 18 Feb 2010 14:48:39 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 30E6B46B66; Thu, 18 Feb 2010 09:48:39 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 3ED3E8A024; Thu, 18 Feb 2010 09:48:38 -0500 (EST) From: John Baldwin To: freebsd-current@freebsd.org Date: Thu, 18 Feb 2010 09:31:56 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20100120; KDE/4.3.1; amd64; ; ) References: <8630BB25CB8C41E8BF036431AAC9B0A9@vosz.local> In-Reply-To: <8630BB25CB8C41E8BF036431AAC9B0A9@vosz.local> MIME-Version: 1.0 Message-Id: <201002180931.56374.jhb@freebsd.org> Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 18 Feb 2010 09:48:38 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Alexander Zagrebin 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: Thu, 18 Feb 2010 14:48:39 -0000 On Thursday 18 February 2010 7:39:28 am 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. > > 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. > > 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? If you don't get a reply, submit it as a PR so it doesn't get lost. -- John Baldwin