nfsclient: incorrect st_blksize (bug?)

Ali Niknam ali at transip.nl
Mon Jul 29 12:37:43 UTC 2013


Hi All,

I've come across a problem that has proven to be unsolvable for me so 
far. It might be a bug in the NFS Client code, it also be my general 
lack of knowledge :). Can someone please give me a hint in the right 
direction?

This is the case:

mount_nfs -o rsize=32768 -o wsize=32768 -o nfsv4 -o tcp host:/path /mnt/nfs

stat /mnt/nfs gives st_blksize of 4096 bytes.
statfs /mnt/nfs gives an iosize of 4096 bytes.

Mounting with nfsv3 gives the same results, regardless of udp or tcp 
protocol. NFSv2 however seems to give a st_blksize of 128k, with an 
iosize of 8192 bytes.

In short: it seems that with BSD 9.1 the rsize/wsize's arent passed 
along correctly. I tried to debug it by looking in the kernel code but I 
got lost unfortunately in the abstraction layers (everything seems to 
set NFS_FABLKSIZE).

Mounting the same host on a linux machine gives the correct st_blksize 
(32k).

The disadvantage is ofcourse that apache/etc adhere to the 4k st_blksize 
by only reading 4k chunks so that nfs io slows down substantially.

Ofcourse I'm also prepared to do further testing if that's needed.

Kind Regards,

Ali

-- 
   Transip BV | http://www.transip.nl/


More information about the freebsd-fs mailing list