ZFS statfs problem

View: New views
1 Messages — Rating Filter:   Alert me  

ZFS statfs problem

by Alexander Zagrebin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!

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 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 generates unjustified cleaning of a cache.
There are the some possible solutions:
- to set recordsize to lower value (for example, 2K), but it's not optimal
for file system.
- to force squid to use 512 as block size (via patch)
- to change the zfs code (zfs_vfsops.c) to return 512 as f_bsize and
recordsize as f_iosize
(see attached patch for 8.0-RC1)
I think that the last solution is more correct.
The patch seems to be working, but i'm not sure that it's correct.
Would you comment this?

--
Alexander Zagrebin


_______________________________________________
freebsd-fs@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-fs
To unsubscribe, send any mail to "freebsd-fs-unsubscribe@..."

patch-zfs_vfsops.c (1K) Download Attachment