ZFS: statfs and recordsize problem

Pawel Jakub Dawidek pjd at FreeBSD.org
Fri Feb 19 20:19:00 UTC 2010


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.
> 
> 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?

I committed (slightly modified version of) your patch to HEAD.
Thanks!

-- 
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd at FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20100219/4a19899b/attachment.pgp


More information about the freebsd-current mailing list